auto fill field in a table by filling one field in list box

J

Jeffrey Reed

I have a two tables; users_table and orders_table.

users_table has the following colums: userid, username.

orders_table has the following colums: orderid, userid,
username.

orders_table has a list box that displays the name field
from the users_table. i want my query to fill in the
userid field from the users_table when i select the
username field in the drop down list box in the
orders_table.

Is it possible to create a query that will perform the
described functionality? If so, how can this be done?
 
J

John Vinson

I have a two tables; users_table and orders_table.

users_table has the following colums: userid, username.

orders_table has the following colums: orderid, userid,
username.

Why?

Storing the username redundantly in the Orders table wastes space and
gives you major headaches if a person changes their name. You'ld need
to track down every order they've made and update the name field.

Just store the UserID in the Orders table. If you need to see the
name, use a combo box bound to the UserID with the Name as the first
visible field (you don't usually need to see the ID on your forms at
all).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top