LOUISBUHAGIAR54
Registered User.
- Local time
- Yesterday, 21:56
- Joined
- Mar 14, 2010
- Messages
- 157
I am using the following vba verse to see if there is a record with certain criteria.
Private Sub Command46_Click()
If IsNull(cltidcard) Then Exit Sub
Dim sodda As String
sodda = (DLookup("[RoomNo]", "Roomlog", "[IdcardNo] = " & Me.cltidcard & " And IsNull (ExitDate)"))
If Not IsNull(sodda) Then
MsgBox "We have already allocated bed" & sodda & "for this patient!", vbExclamation, sodda
Exit Sub
Else
End If
DoCmd.OpenForm "frmAdmission"
End Sub
When I try to run this code I get error message 3075, syntax error (missing operator) in query expression '[IdcardNo] = 34556m And IsNull (ExitDate)'.
Can I please get some help on how exactly to punctuate the DLookup statement?
LOUISB
Private Sub Command46_Click()
If IsNull(cltidcard) Then Exit Sub
Dim sodda As String
sodda = (DLookup("[RoomNo]", "Roomlog", "[IdcardNo] = " & Me.cltidcard & " And IsNull (ExitDate)"))
If Not IsNull(sodda) Then
MsgBox "We have already allocated bed" & sodda & "for this patient!", vbExclamation, sodda
Exit Sub
Else
End If
DoCmd.OpenForm "frmAdmission"
End Sub
When I try to run this code I get error message 3075, syntax error (missing operator) in query expression '[IdcardNo] = 34556m And IsNull (ExitDate)'.
Can I please get some help on how exactly to punctuate the DLookup statement?
LOUISB
Last edited: