I have a table for employees and a table that shows which containers they have access to and a table of all containers.
What i need to do is when adding a new employee i need to add a record to the "access" table for each record in the container table. that would basically default the new employee's access to each container.
I think the following code in my addemployee form_Load event should detect if they have been added. but i'm having trouble with figureing out how to proceed on what needs to done.
the above code should only detect a null if there is not an entry for the employee in the "access" table
what i need help with is:
A) I don't know how to tell how many entreis are in the containers table.
and
B) I don't know how to programitacly add records to a table.
With this information i should be able to simply loop through the containers table and add a record to the access table for the new employee each record in the containers table.
What i need to do is when adding a new employee i need to add a record to the "access" table for each record in the container table. that would basically default the new employee's access to each container.
I think the following code in my addemployee form_Load event should detect if they have been added. but i'm having trouble with figureing out how to proceed on what needs to done.
Code:
Dim emp As String
emp = "employee = " & Staffadd.ID
If DLookup("[Containerstring]", "access", emp) = Null Then
what i need help with is:
A) I don't know how to tell how many entreis are in the containers table.
and
B) I don't know how to programitacly add records to a table.
With this information i should be able to simply loop through the containers table and add a record to the access table for the new employee each record in the containers table.
Comment