automatic entry

cj_steve

Registered User.
Local time
Today, 09:21
Joined
Dec 3, 2002
Messages
12
Hello,

I have a form with 2 fields city and city code. I have a lookup table, County, that has the values for city and city code.

When the user selects the drop down list for city and chooses a city, I also want it to automatically fill in the city code field.

How would I accomplish that?

Many thanks.
 
1.) You could add the city code field as a second field to your CityComboBox's recordsource.
2.) Set the combobox's ColumnCount: 2
3.) Set its ColumnWidths: 1;0
4.) In the combobox's OnClick Event put the following:
Me.CityCodeTextBox=Me.CityComboBox.Column(0,1)
Hopefully this will run after the user makes a selection from the combobox. It sets the Me.CityCodeTextBox equal to the CityComboBox's second column(i.e. CityCode field)
HTH
 
In addition to caseys reply, here a sample that may also find helpful.
 

Attachments

Users who are viewing this thread

Back
Top Bottom