| | |
|
|
|
automatically updating the next field?? |
| message from =?Utf-8?B?S2VsbHlG?= on 26 May 2004 |
In my form I have a list of cities listed in a drop down menu. I want to know if when I select a certain city, the Zip code is automatically inserted that correspondes to that city. For example, if it is CityA then the Zip is automatically inserted to 12345, while if I select CityB from the drop down menu, the Zip is automatically changed to 54321. Does that make sense???
|
| Rob replied to =?Utf-8?B?S2VsbHlG?= on 26 May 2004 |
Generally, I think it would be better to do this the other
way, as cities can have more than one ZIP. Put the ZIP in
first, and use a table lookup to pull in the correct city
when the ZIP control's AfterUpdate event occurs.
Since you are pulling cities from a list in a drop down, I
assume you are working with a specific subset and the city
and ZIP have a 1:1 relationship. If this is the case, you
should never need to modify the ZIP, so your ZIP field
could just be an unbound control with a DLookUp function
to display (but not store) the appropriate value.
If that isn't going to work for your purpose, there are a
few different ways to make it work. The best approach to
take is dependant upon your data source for the list box.
Is it a value list, table, or a select statement? If it
is a table (or select), is the ZIP also in that table?
Rob
menu. I want to know if when I select a certain city, the
Zip code is automatically inserted that correspondes to
that city. For example, if it is CityA then the Zip is
automatically inserted to 12345, while if I select CityB
from the drop down menu, the Zip is automatically changed
to 54321. Does that make sense???
|
|
Archived message: automatically updating the next field?? (MS Access)