Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box fill in

Status
Not open for further replies.

kaypee19

Technical User
Dec 11, 2001
2
US
This is how I set up the database:

tblCompanyInfo
fldCompanyID autonumber
fldCompanyName text
fldAddress text
fldState text - lookup to tblStates
fldZipCodes number

tblStates
fldStatesID autonumber
fldStates text

tblZipCodes
fldZipCodesID autonumber
fldZipCodes number
fldStateID number

tblStates has a one-to-many relationship with tblZipCodes
tblCompanyInfo.fldStates is a combobox that looks up a list of states from tblStates

I would like to create a form that fills in tblCompanyInfo, but when I get to the state field, I want to pick the state I want from a drop down box. After I pick my state, I want to click in the drop down box under ZipCode and only see ZipCodes for the state that I selected. If I choose a different state, I want to ZipCodes to update.

The update part is done in VisualBasic. Is it done under the General section or under the combobox for the ZipCode or somewhere else? The SQL statement, is that done as a query and then the combobox of the ZipCode points to that query or can you write the SQL statement somewhere else?

I appreciate any help and any suggestions regarding this database.
 
the combobox2's recordsource becomes

"select zipcode from table where state = '"& me.combo1.value & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top