Hi All
I am having an issue using DCount to validate against 3 fields within my database. I have a booking form which contains a Staff member, viewing slot, and Viewing Date which is used to book property viewings.
I want the form to check that the booking doesn't already exist when the process booking button is pressed.
I am using the following statement:
I always get the error "Syntax Error (Missing Operator)".
Can anybody help with this? Or let me know if there is a better way to do it. Sorry if its not explained properly, Im not that ofay with VB.
Much appreciated in advance.
Sully
I am having an issue using DCount to validate against 3 fields within my database. I have a booking form which contains a Staff member, viewing slot, and Viewing Date which is used to book property viewings.
I want the form to check that the booking doesn't already exist when the process booking button is pressed.
I am using the following statement:
Code:
If DCount("*", "Viewing", "[Staff_ID]=" & Me.[Staff_ID] & " AND [Viewing_Period] = " & Me.Viewing_Period & "' AND Viewing_Date = '" & Me.Viewing_Date) & "'" > 0 Then
MsgBox "Cannot book, booking already exists", vbCritical
End If
I always get the error "Syntax Error (Missing Operator)".
Can anybody help with this? Or let me know if there is a better way to do it. Sorry if its not explained properly, Im not that ofay with VB.
Much appreciated in advance.
Sully