Setting form field = another field on same form

G

Guest

In tblEmployees, I have an EmpID field (Primary key) and a NewHireID field
(indexed to accept no duplicates). I am building a form (frmAddNewHire)
based on this table where when a potential new hire record is added, the
EmpID field is entered as NEWHIR01, NEWHIR02, etc. Upon exiting the EmpID
field, I want the NewHireID field to be set to the value of the EmpID field
so that when the record is saved, both fields contain the same value. I
can't get this to work using VBA, but I've tried the following with the On
Exit event of the EmpID field:

Private Sub EmpID_Exit(Cancel As Integer)
NewHireID = EmpID
End Sub

I'm sure I have the syntax wrong above, but am I on the right track?

The purpose of the NewHireID field is to track all records initially entered
as NEWHIR #'s. Eventually, as the new hire becomes an official employee,
their EmpID is changed to a different value, but the NewHireID they were
originally given when their record was created needs to be retained. Thanks
for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top