I'm modifying an Access 2000 database created by a co-worker who is no longer with the organization, and is trying to figure out one part of the program. The database has two tables, tblemployees and tblCorrectiveAction. The tblemployees has fields ENAME, UserID, and a few others. TblCorrectiveAction has an autonumber field named Corrective Action ID, Originator, OrigDept, DateofCA, and several other fields. Then there is a form that has text boxes bound to Corrective Action ID, Originator, OrigDept, and DateofCA. When the form opens, the program looks for the currentuser (logged-in to the computer) and matches the UserID to print the Originator. Then, it fills in the DateofCA and OrigDept. How does the program look at the autonumber field (Corrective Action ID) and fill in the highest number?
The person is using
- Sub AssignName()
-
If Not IsNull(DLookup("[ENAME]", "tblEmployees", "[UserID] = ... etc as part of initial lookup.
-
Me!txtOriginator.Text = DLookup("[ENAME]", "tblEmployees", "[UserID] =
-
more lines ....
-
End If
-
End Sub