How do you populate a form field value into two tables?

Merlin

New member
Local time
Yesterday, 21:06
Joined
Jul 11, 2002
Messages
9
I have a form that populates a field on a table. How can I get the field entry to populate a different table as well?

Form records employee name and populates tbl_employee name field. I would also like that same entry to be recorded on a tbl_employee_end. I think an Afterupdate will do it but I don't know how to call the tbl_employee_end from the form(it references tbl_employee) and populate it with the value in the name field.

VBA? Macro? Something simpler?

Any ideas?

Thanks
 
Merlin,

First, I must say that you should not store the same
information in multiple places.

Code:
Dim dbs As  DataBase
Dim sql As String

Set dbs = CurrentDb

sql = "Insert into tbl_employee_end (NameField) " & _
      "Values ('" & Me.YourControl & "');"
dbs.Execute(sql)

Wayne
 

Users who are viewing this thread

Back
Top Bottom