Auto-Assign a value to a combobox based on a previous combobox entry (1 Viewer)

sguan

Registered User.
Local time
Today, 21:23
Joined
Jul 7, 2011
Messages
10
I am a fresh beginner in Access so please take my apologies if I haven't explained the below issue clear enough and let me know so that I can further explain it in moer details.

I have two comboboxes; Combo A and Combo B, coming from the same record-saving table but within that table they are coming from two separate, independent tables.

I would like to autoassign a value to Combo B when the user selects a value in Combo A which has been selected before. The value I would like to assign to B should be the same as the value the user selected in Combo B in the previous record when he selected the same value for Combo A. This means those two combinations of Combo A and Combo B should be the same.

Im doing this to save time and make it easier for the user so they don't have to repeatedly selecting a combination which is identical to previous ones.

I would apperciate if someone can provide me the VBA code for this function.

Thanks so much in advance!
 

GinaWhipp

AWF VIP
Local time
Today, 09:23
Joined
Jun 21, 2011
Messages
5,899
Perhaps you can make this work for you...

Code:
Private Sub YourField_AfterUpdate()
     Me.YourField.DefaultValue = """" & Me.YourField.Value & """"
End Sub
 

Users who are viewing this thread

Top Bottom