I have a relatively simple Access 2007 question, but as a newbie I am not sure how to get what I need. I should also note that I inherited an existing application that I am modifying.
I have a simple "Add Employee" form that allows the employee's group to be selected via a drop-down list that is bound to the "Groups" table. So far, so good, and the drop-down works fine.
Now, when the user presses the "Save" button, I can take the rest of the textboxes and use them for the insert into the Employees table, but at this point I now need to translate the Group name to be the Group ID, which is what is stored in the Employees table.
Currently, I created a query called queryActiveGroups which is what the drop-down is bound to. It does NOT grab the Group ID, just the name and status.
Is there a way to make the Group ID available to my VBA code if I include it in the query but mark it as "not shown" (or something like that)?
I have used embedded selects in Oracle, where you could do the following (SQL pseudocode):
insert into employees(name, group_id) values (lstEmpName, (select group_id from Groups where Group_Name = cboGroupName));
Thanks,
Mitch