PDA

View Full Version : Solved: Combo boxes, do they work like HTML where you can have different data behind display?



Austin
09-10-2008, 11:46 AM
Soooo

How can I save to the backend database a different value than what is displayed to the user?

Say I run a query for the rowsource that displayed states and each state has an identifier that needs to be stored, how would I do this?

CreganTur
09-10-2008, 12:12 PM
It depends on exactly what you're trying to do.

For example (using your state example), if you want the state name to appear for the Customer in the combobox, but you need the state abbreviation to go into your database, then you could do this by:

create a query that pulls the state abbreviation first, the state name second
set the combobox to use this query
set the combobox to have 2 columns
set the witdth of column 0 (the first column) to 0"This will setup your combobox so that it only shows the User the state's name. To pull the state abbreviation into your database, you would just reference the value of the combobox's column0

If this isn't what you're looking for, then could you be a little more detailed in your request? The more info we have, the easier it is for us to help.

Oh, and welcome to the forums:thumb

Austin
09-10-2008, 12:17 PM
That did exactly what I was looking for! Thanks!

CreganTur
09-10-2008, 12:21 PM
That did exactly what I was looking for! Thanks!

Glad to help!

Whenever your issue gets resolved, could you help us out by marking your thread as solved?

At the top of this window click Thread Tools -> Mark As Solved -> Submit

Thanks:hi: