473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Lookup Values for ComboBox

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

Nov 21 '05 #1
1 1476
Hi,

Take a look at the comboboxes displaymember and valuemember.

http://msdn.microsoft.com/library/de...embertopic.asp

Ken
---------------------
"Kenneth Hutson" <ke********@goetting.com> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
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


Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Marco Simone | last post by:
Hi, What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2. Is this good design of database? ...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
3
by: Jimmy | last post by:
I'm not sure the subject line is a very clear description of my problem so... I have two relevant tables for this issue... the lookup table tblLookupItems with three fields . The control...
3
by: john | last post by:
In my form (table A) I have subform (table B (only 2 fieds: ID and App_name) where table A -Table B are linked 1XM. To be able to add a record in the subform I want to use a lookup form since the...
5
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I...
2
by: Randy | last post by:
Hi, I'm trying to populate textbox values upon a change in a combobox selection. I'm using the Publishers table in the Pubs sample database as a simplified example. Here is the code: Private...
3
by: Radu | last post by:
Hi. I have the following problem - I need to build a user-control in asp.net (an ascx) to somehow allow the users to search by first name or last name among a big (~10.000 records) email addresses...
14
by: Mark | last post by:
I have a table with a field that uses a combobox to populate values. The Lookup tab within table design mode is the following: Display Control Combo Box Row Source Type ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.