using combo boxes to input data into fields

rnutts

Registered User.
Local time
Today, 16:05
Joined
Jun 26, 2007
Messages
110
Hi

Have a form with 2 combo boxes on it, titled combobox1 and combobox2
Combobox2 is related to combobox1 depending on the selection made. What I have done is to create a query that pulls the information for combobox2 to utilise depending on the selection in combobox1. Nothing difficult so far. However Combobox2 is the last variable in the form and what I want to do is to put the rest of the record into the form(site details) from the query based upon the selection within combobox2, there are 5 other fields to populate

Address1
Address2
Town
County
Postcode

I hope this is clear and that someone can help me. My knowledge of code is very limited and I have been trying to use a macro with SetValue, but the macro wont recognise the query name so I am stuck.
Below is the expression I have been trying to use which is not working in the macro

IIf(([Forms]![Site Details]![Client]="Nationwide Asbestos Property Surveys Ltd"),[Query]![SubClient]![Organisation/Group],Null)

thanks in advance for any help

Richard
 
Add the other 5 fields into your second combo, but set the column widths to 0 so they are hidden. In the After Update event of the second comb, set the values of your other controls like this:
Me.txtMyControlName = Me.MySecondCombo.Column(2)

Bear in mind that column numbering starts at zero, so your third column is Column(2)
 
thanks, works great
 

Users who are viewing this thread

Back
Top Bottom