Solved Display Name Instead of Id In Form (1 Viewer)

jo15765

Registered User.
Local time
Yesterday, 16:55
Joined
Jun 24, 2011
Messages
130
I have a table that has a itemId column, then another table that has the itemName. I created a form for the table that has the itemId, so numeric values are displaying on the form. How can I have the form "lookup" or display the itemName so I have a meaningful name on screen for non-technical people?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:55
Joined
Oct 29, 2018
Messages
21,476
You could try using a Combobox for that field.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:55
Joined
Oct 29, 2018
Messages
21,476
ummmm, over my head here...how would I do that?
Did you want the user to edit the data or are they supposed to just look at it?

In the form's design view, you can replace the textbox with a combobox and assign a row source that uses the table with the descriptive name.

If you don't want the user to change that data, you can go to the record source of the form and simply use a query adding the other table, so you can pull the descriptive name instead of the numeric value.
 

jo15765

Registered User.
Local time
Yesterday, 16:55
Joined
Jun 24, 2011
Messages
130
Ahh....I do not want the user to be able to edit/modify just see the "pretty" name

Okay, that makes sense to me. I originally clicked on the table and did build form, Maybe I should have clicked both tables and not just one
 

jo15765

Registered User.
Local time
Yesterday, 16:55
Joined
Jun 24, 2011
Messages
130
okay that was super easy, looking at the form source, and using the queyr editor to build out my query!
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:55
Joined
Feb 19, 2002
Messages
43,302
Unless you have turned wizards off, the wizard will pop up to help you when you add a combobox to a form. The form wizard isn't smart enough to create the combo initially. Once you understand how they work, you can right-click on a text box and ask Access to convert to a combo but you need to know what all the settings need to be. So, for now, delete the text box, add the combo in its place and follow the wizard. You need to do two things after the wizard is done:
1. change the name of the combo to something meaningful like "cboMyFieldName"
2. Change the tab order on the form so that the combo replaces the text box in the sequence as the user tabs through the controls.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:55
Joined
Feb 19, 2002
Messages
43,302
If you join the tables in the query, make absolutely sure to lock the control bound to the text field. You do not want to accidently update it. The proper way to update a field of this type is by using a combo - see previous reply.
 

Users who are viewing this thread

Top Bottom