Automatically filling in data on a table

keeling1

Registered User.
Local time
Today, 01:46
Joined
Jun 8, 2009
Messages
27
This should not be difficult, but I can't figure out how to do it.

Very briefly, my database is meant to help technicians fix broken machines. There are hundreds of machines, so they're broken into groups. There are two tables in play here. The first has columns for Group name and an auto-generated Group ID number. The second table has columns for Group name, Group ID number, Machine name, and an auto-generated Machine ID number.

What I want it to do is the following. When I enter a new machine and select what group it's in, the table should automatically give it the correct Machine Group ID number, based on the first table I described. The tricky part is automating it. The reason is needs to be automated is that I'm having the user use a form when adding machines. He chooses a Group name and then types in the name of the new machine. (The number is important only because there's a combo-box I'm using on a different form which requires it.)

Thanks in advance for the help.
 
Hi Keeling,

I think your problem is a fairly easy one to solve. First, however, Your second table should only refer to the groupID field from the first table, not the group name.

Second. I think that what you need is a combo box in a form. The combo box can be linked to the GroupID of the first table (and therefore the group name) but show the Group name (I am pretty sure this can be done by modifying the combo box query and the columns in the properties box for the control) and you would set the combo box to place the selected value into the GroupID field in your second table.
 
Thanks for your help, Kryst51. I've solved the problem.
 
My Good! I have the same problem. Am I lucky or not, I desperately was searching all over the web to solve it. I do nod deal with machines, rather with accessories and jewels. Thanks keeling1!
 
Keeling, I never responded to your post, did my answer help or was it something different that you did to fix your problem?
 
Kryst51, your answer put me on the right track. What I did was just to get rid of the ID numbers completely. I was using them because when I set out to do dependent combo boxes, I found help online and simply copied what someone else had done. I think the ID numbers were there in the code I copied to make things run faster, but things run fast enough without them. They were ultimately unnecessary, and eliminating them eliminated the problem too. Thanks.

Glad to hear your problem is solved too, amyconnor.
 
OK, I wanted to know, purely for knowledge sake, and so amyconnor could maybe solve her problem too ;) Than you!
 

Users who are viewing this thread

Back
Top Bottom