Scenario is:-
Tble 1 contains #ID (Long), Name (String) etc.
Tbl 2 has Name, Date etc but not an ID.
I have a form which has takes info for Tbl 2 and I have caputured the ID from the Login function.
I now want to compare the Name Chosen for Tbl 2 with the Login ID I have captured to see if the Name in both Tbl 1 & the Form for Tbl 2 Match.
I am getting really confused with the logic and wonder if you can advise me.
My Current Code is as follows:-
Expand|Select|Wrap|Line Numbers
- If loginID = DLookup("strEmpName", "tblEmployees", "[lngEmpID] =" & Forms![frmBookings.BookName]) Then
- 'MsgBox ("Login Name Matches Login ID")
- 'Me!BookName.SetFocus
- 'Else
- 'MsgBox ("Not Matched")
- 'Exit Sub
- 'End If
I Need to look in the tblEmployees and find the name associated with the ID which = LoginID.
Once I have this I can compare Names to see if they are equal.
I know my code is wrong but my brain has gone and I cannot figure out the logic.