Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form shows key field

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
One of my tables has a field in it that looks up into another table to get the info. (i.e. Campaign Name).

When I created a form to use for data entry into that table instead of showing me the name of the campaign I see the number that associates that field with the record in the Campaign Table.

What can I do to fix this?

Sharon
 
You want to keep the field with the ID number hidden (you still need it though).

On another visible textbox, you could put in the control source something like:
Code:
=Nz(DLookup("[Campaign Name]","[Campaign Table]","ID=" & Me.CampaignID),"")


 
Remou,

Thank you for the link. I see using lookups is $%%%&^$#%^.

That said.

Do you have something I could read on how to use the query or combobox. I'm not clear on how a query would help me.

I just didn't want to type the data in field for each pledge. (too many chances to type it in wrong) I was told use the lookup feature, so it always returns the same info.

Sharon
 
JoeAtWork,

I'm gonna try this and see if I can get it to work.

Sharon
 
The combox would have a rowsource that referenced the lookup table and would have column widths set such that the key field is hidden. The wizard will guide you through creating such a combo box. It is useful for forms. For reports, you would generally create a query. The query would join the main table to the lookup table:

[tt]SELECT *
FROM Main LEFT JOIN Lookup ON Main.ID = LookUp.ID[/tt]

Setting up relationships in the relationship window can make the whole thing more automatic.

You may wish to study the Northwind sample database, which illustrates many useful techniques.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top