Reputation: 41
I've got two tables that contain the following.
Table Name: Enquiries
ID
Username
Date of Raising
Time of Escalation
Invoice
Repeat Contact
Query Type
Context of Query
DC
Table Name: PC
PCID
PCarea
Town
DCArea
DCName
I currently have a Form setup with the above fields all selected. I have PCArea setup as a drop down as the field has 2000+ records (Postcodes). What I want is when a person updates this field/drop down/combo box for Access to lookup the PCArea and find out what the DCName is relevant to this and then populate the DC field in "Enquiries" and show on the form but I can't fathom how to do it.
I know it's VBA related but I can't seem to get the format right?
Private Sub Combo472_AfterUpdate()
Me.PCArea = Me.Data.Column(9)
End Sub
Sure didn't work! Any help would be great.
Upvotes: 0
Views: 4446
Reputation: 375
Replace {PCAreaDropDown} with name of your dropdown box, and all you really need is the one field in there. It looks like you threw at least 10 columns (9+1) based on your example.
me!DC = dlookup("DCName","PC", "PCArea = '" & me!PcAreaDropDown & "'"
Upvotes: 1