experience
Jun 7 2008, 10:56 AM
I've created a lookup value from another table, when i add the lookup field to my form it appears in a drop down box. I want the lookup value to appear in a text box automatically instead, if i convert the drop down box to a text back i get the ID of the lookup table appear instead of the field value i want to appear.
What should i be doing instead?
Thanks
Jack Cowley
Jun 7 2008, 11:12 AM
You want the Primary Key of your lookup table saved in the field of your other table. Let's assume a table listing States:
tblStates
StateID (PK and auto)
StateName
Now assume a customer table
tblCustomers
CustomerID (PK and auto)
LastName
FirstName
Address
City
StateID (Number)
Now your form, based on tblCustomer will have a combo box based on tblStates. You will select the State from the combo box, but you will store the StateID in tblCustomers, NOT the StateName. You can show the StateName at any time by using a combo box on your form/reports out basing the form/report on query made up of the two tables...
hth,
Jack
experience
Jun 7 2008, 12:07 PM
I think thats how i've got it setup at the moment. but i dont really want to have to use a combo box. Is there anyway of having the field in this case Statename appear automatically without having to drop it down from a combo box. In my case there is will only be one value in Statename
Jack Cowley
Jun 7 2008, 12:14 PM
If there is only one State then I see no reason for a State Lookup table. In your form set the Default Value of your State control to the name of the State. Now when you go to a new record the State will be filled in for you and no need to make a selection...
hth,
Jack
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.