Im getting an error with this bit of code:
VB Code:
Dim sForename As String Dim sSurname As String Dim sCode As String sCode = DLookup("staffCode", "booking", "bookingDate = #" & dDate & _ "# AND timeID = " & timeID & " AND areaID = " & areaID) sForename = DLookup("[staffForeName]", "staff", "[staffCode] = " & sCode) sSurname = DLookup("staffSurName", "staff", "staffCode = " & sCode) MsgBox "The booking has already been booked by " & sForename & " " & sSurname
Its screwing up on the "sForename = DLookup" line.... and the "sSurname = Dlookup" line
Any help would be appriciated!!![]()




Reply With Quote