Lookup Values for ComboBox

K

Kenneth Hutson

Hi group,

Sorry, I had erroneously posted this question earlier in the wrong
newsgroup.

I have an Access database with two tables. The tables are OFFICES and
STATES.


Table STATES has two fields; [STATE ID] and [STATE SHORT] (two letter state
abbreviation). [STATE ID] is the primary key (data type autonumber).

Table OFFICES has fields [ADDRESS], [CITY] and [STATE ID] (data type long).

The tables are related by [STATE ID]

I want to display controls for table OFFICES on a windows form. I want the
[STATE ID] control to be a combobox that shows the state abbreviations (two
letter) from
the STATES table in the dropdown list. The actual value stored in
OFFICES.[STATE ID] would be the primary key value from the STATES table.

How can this be done?

Thanks,
Kenneth Hutson
San Antonio, TX
 
K

Ken Tucker [MVP]

Hi,

Take a look at the comboboxes displaymember and valuemember.

http://msdn.microsoft.com/library/d...dowsformslistcontrolclassvaluemembertopic.asp

Ken
---------------------
Hi group,

Sorry, I had erroneously posted this question earlier in the wrong
newsgroup.

I have an Access database with two tables. The tables are OFFICES and
STATES.


Table STATES has two fields; [STATE ID] and [STATE SHORT] (two letter state
abbreviation). [STATE ID] is the primary key (data type autonumber).

Table OFFICES has fields [ADDRESS], [CITY] and [STATE ID] (data type long).

The tables are related by [STATE ID]

I want to display controls for table OFFICES on a windows form. I want the
[STATE ID] control to be a combobox that shows the state abbreviations (two
letter) from
the STATES table in the dropdown list. The actual value stored in
OFFICES.[STATE ID] would be the primary key value from the STATES table.

How can this be done?

Thanks,
Kenneth Hutson
San Antonio, TX
 

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