DLookup is used to look up data in a table or query.
DLookup(Data,Name of table,criteria) Look in the help file for more detailed information.
Here is an example:
UserName = DLookup("[UserName]", "tblClasses", "[ClassID] = " & txtClassID.Value & " And [UserName] = """ & txtUser.Value &...