Question Locked

Problems with Access Forms

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi! I'm a novice Access 2007 user. I'm trying to make a form to make my data easier to enter. The form is basically used to enter what employee was driving what truck on the given day, as well as a couple of other values.

I'd like my users to be able to select the employee name from a drop-down list with the values coming from the Employee table. But I would like the employeeID number (which is the
primary key for the employee table) to go into it's matching field in the "Day" table, which actually records the data about which truck was driven by which employee.

I'd like the same thing to happen for the trucks. They should be able to pick the license plate number from the list and have the primary key from that table entered into the Day table.

Can I even make this happen? I've tried, but to no avail. My original drop-down list contained all the values I wanted, but when I typed in a sample record and updated my table, the number '2' appeared in the first name field on my Employee table, not the Day table!

Could someone explain to me how to do this, but in the simplest terms possible? Access is making me into an idiot...

5 replies

by jsuess

Well, I searched "master - detail", I found some nice articles, but I read all of them and didn't find my answer. Is there some search result in particular I'm supposed to be looking for? Or did I interpret that answer wrong?

by tony hopkinson

Day's as Detail, would do the job.
Establishing the master detail relationship, (on employee_id) would pop the link in automatically.
If you want more control than that, Access wise I'm not the best guy to answer.
If I was doing it.
I'd populate the combo from a query on employees, test the name value the id,
On select if in (add mode) then I'd force an insert on days and set the employeeid and then go from there.

The other thing you might want to look up is lookup lists. :D

There you have the combo box in the Days record, it would display employee names nut put the id's in the table.

This discussion is closed to new replies.