Query shows id instead of value (1 Viewer)

aimoFIN

New member
Local time
Today, 12:45
Joined
Feb 13, 2019
Messages
6
Hello to everybody! This is my first database and probably problem is quite small but I can't find solution to it.

I have problem with query which is showing ID instead of value.

I have 3 tables, Orders, Customers and Products. All fields are text boxies, no lookups.
Data is inserted to Orders table with Orders_form where is Lookup combo boxies and lookup tables are Customers and Products.

Form is showing values (customer and product names) but query shows only id's. I have tried everything I have found with google to solve this but nothing has helped.

Tried to join tables in query, after that query shows nothing. If tables are not joined query shows id's.
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:45
Joined
Jan 23, 2006
Messages
15,364
Please post a copy of the database in ZIP format.

It appears that you may be showing the ID column because of the Format setting of the combo.... but seeing the database will get you focused response.
Good luck.
 

aimoFIN

New member
Local time
Today, 12:45
Joined
Feb 13, 2019
Messages
6
Here is the db.
 

Attachments

  • Orders.zip
    25.8 KB · Views: 60

jdraw

Super Moderator
Staff member
Local time
Today, 15:45
Joined
Jan 23, 2006
Messages
15,364
I'm not sure of your intent, but it seems there may be a design issue.

Can a Customer order more that 1 product at a time? That is can an Order have multiple Products?
If yes, then you may be missing a table --OrderItem.
 

aimoFIN

New member
Local time
Today, 12:45
Joined
Feb 13, 2019
Messages
6
That is only example database about the problem. I made simple database to find the problem but I haven't found it yet.

If I can make this database work, I can make the real one work also.
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:45
Joined
Jan 23, 2006
Messages
15,364
Just describe what you want this database to do.

I think your Order table is not correctly designed. Normally you would have named ids
eg CustomerId, ProductID, OrderID . In your Order table you could have OrderID, but your Customer and Product fields would be number datatype and contain the CustomerID and ProductID respectively. Your set up is trying to join records number to short text.

Before fixing the combo, you might consider the "missing table" and determine if that's what you want ---more than 1product possible per Order.

Good luck with your project.
 

aimoFIN

New member
Local time
Today, 12:45
Joined
Feb 13, 2019
Messages
6
Thank you!

Problem was the different data types. I changed id's to Customer_id etc. and changed datatypes in Orders table. Now it is working in this simple database and the real one.

Now I can continue building the real one:)
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:45
Joined
Jan 23, 2006
Messages
15,364
Good stuff. Happy to help.
 

George21

Registered User.
Local time
Today, 21:45
Joined
Jan 10, 2011
Messages
27
A more correct way is to assign Index in the Orders Table and fix the relations in the query (I haven't touched the form).

Check it out.
 

Attachments

  • Orders.zip
    22.9 KB · Views: 86

Users who are viewing this thread

Top Bottom