Autopopulate question

A

Antavas

I have a data table with a list of states and the regions they fall into
(Southeast, Northeast, etc)

On my form I need it to populate the correct region when I choose a state
from a dropdown box. How do I go about this?
 
L

Linq Adams via AccessMonster.com

Use the Combobox Wizard to make a combobox based on your state/region table,
with the state field first and then the region field next. Then, because the
columns of a cbo are zero-based, you want the second column, which is (1) in
the textbox for the region:

Private Sub StateRegionCombobox_AfterUpdate()
Me.txtRegion = StateRegionCombobox.Column(1)
End Sub
 
A

Antavas

The state box has already been created in the form. I'm having to add in the
Region box on its own. How can I link them when I choose a state from the
drop down so the correct region will populate?
 
J

John W. Vinson/MVP

The state box has already been created in the form. I'm having to add in the
Region box on its own. How can I link them when I choose a state from the
drop down so the correct region will populate?

If you're trying to store the Region into a table other than the
States table... *don't*. It's redundant, unnecessary, and even
dangerous (you might later decide to split a region into two, and you
would then have obsolete data in your table). Just store the state and
use a Query or the combo column property as suggested to *display* the
region.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top