If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to associate predefined numeric value to drop-down list option
Hi everyone,
It seems to be a simple task but I don't know the proper keywords to descibe the problem. So, rather than using google, I am asking for help here. A field has only three possible companys: A, B, and C. They are assigned with numeric numbers 1, 2, 3, respectively. Validation rules are established. Now I want to create a form with a list box showing the companies' names rather than the numbers. However, I want the values to be save as 1, 2, 3 in the table. Can anyone kindly give some clue? Thanks a lot! |
#2
|
|||
|
|||
How to associate predefined numeric value to drop-down list option
"Tommie" wrote in message
... Hi everyone, It seems to be a simple task but I don't know the proper keywords to descibe the problem. So, rather than using google, I am asking for help here. A field has only three possible companys: A, B, and C. They are assigned with numeric numbers 1, 2, 3, respectively. Validation rules are established. Now I want to create a form with a list box showing the companies' names rather than the numbers. However, I want the values to be save as 1, 2, 3 in the table. Can anyone kindly give some clue? Thanks a lot! Actually the above request as pretty much how access works by default when you build a combo box using the wizard. Simply create a table to store the companies. Include an auto number ID field. Type in the first company name, and the autonumber id will be one, now, simply type in the next two company names in of a table with the three company names, eg: tblCompanyNames id CompanyName 1 Macdonalds 2 Burgar King 3 A & W Now in that form simply use the wizard to build a combo box. When asked where the values for the combo box or to come from simply use the above table you made, in fact if you said ID up as what's called a primary key, then access will actually hide the first column for you automatically. the result be that you store the ID, but it's plays and sees the company name. As mentioned, most combo box taxes work this way as you often are displaying some part description or something else, but you want a store the ID or primary key of an actual record. -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada |
#3
|
|||
|
|||
How to associate predefined numeric value to drop-down list option
Either use a table with the 3 values, or a ValueList if they will never be
changed or added to: In the combo or List box property sheet create 2 columns, bind column 1, (the ID value) to the Combo or List Box, Bind that column to the table field. Set the column widths to: 0", 1" The table will store the numeric but display the textual value. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Tommie" wrote in message ... Hi everyone, It seems to be a simple task but I don't know the proper keywords to descibe the problem. So, rather than using google, I am asking for help here. A field has only three possible companys: A, B, and C. They are assigned with numeric numbers 1, 2, 3, respectively. Validation rules are established. Now I want to create a form with a list box showing the companies' names rather than the numbers. However, I want the values to be save as 1, 2, 3 in the table. Can anyone kindly give some clue? Thanks a lot! |
Thread Tools | |
Display Modes | |
|
|