Calculated field shows keyID instead of value. (1 Viewer)

jonasjacobs87

New member
Local time
Today, 06:26
Joined
Mar 28, 2018
Messages
3
Hi all,

I have a table dogs (tblHonden) in which i look up breed in a table (Ras, tblHondenrassen) and owner (tblKlanten).
When I try to calculate a field showing [Naam] & " - " & [KlantID] instead of Max - Jonas Jacobs I get Max - 2. The 2 refers to the [KlandID] but instead of showing the name it shows the actual keyID.

Any clue on how I can fix that? I would like to use the "Max - Jonas Jacobs" field in frmHonden to navigate to records on that form.
 

Attachments

  • Database upload 20180411.zip
    297.9 KB · Views: 91

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:26
Joined
Feb 19, 2002
Messages
43,223
Based on your expectation, I believe that you are using a lookup field for KlantID. Please remove the lookup from that field. All it is doing is hiding the true value of the field which is fact numeric. Lookups (combos) SHOULD be used on forms but NOT on tables. Users never see tables or queries in a properly defined application. They only see the forms and reports you create for them so the crutch of the table level lookup is really only for you. Once you start making queries and writing code, you will continually run into issues with the lookups not working as you expect them to so get rid of them now.

To fix your query, open the QBE and add tblKlanten to the grid. If you have created a relationship using the relationship window, Access will automatically draw the correct join line. If you haven't created relationships (why not), then you'll need to draw the join line manually. Change the join type to left by double clicking on the middle of the join line and choosing the option that says to show all tblHonden. Then choose the name field from that table.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:26
Joined
May 7, 2009
Messages
19,231
Here you may try
 

Attachments

  • Database upload 20180411.zip
    185.3 KB · Views: 88

Users who are viewing this thread

Top Bottom