New Field in form question

  • Thread starter Thread starter Antavas
  • Start date Start date
A

Antavas

I have a form that has a state field. I have to add a region field to the
form that must autopopulate based on the State selected from a drop down box.
Since the state field already exsists how do I do this?
 
If the [Region] is automatically determined by knowing [State], you don't
really need to (redundantly) store [Region], right?

If you have a lookup table of State Region, you could use the query that
feeds the State drop-down on your form to also return the [Region] for that
state.

Then you could add something like the following to the AfterUpdate event of
the State drop-down:

Me!txtRegion = Me!cboState.Column(1)

where .Column() is a zero-based list of the columns in the query feeding the
combobox (drop-down).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Antavas,
DLookup is your friend here.

On the after update event of the state combo, use DLookup to get the region
name from the appropriate query.
To get help on DLookup, type DLookup in the immediate window, put cursor in
the word and press F1.
You set the value of the text box for Region to the value you get from
DLookup.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top