Hello everyone:
This question is neither urgent nor important, but I post it just in case anyone knows (and wants to give a reply, of course XD).
I have little idea of VBA, but I have dared to write a little piece of code. It is as follows:
- Private Sub Comando551_Click()
-
Dim qry As String
-
qry = "BUSQUEDA PACIENTES"
-
DoCmd.OpenQuery qry
-
If [BUSQUEDA PACIENTES].[HISTORIA] Is Not Null Then
-
MsgBox ("This person is present in the DB")
-
Else
-
MsgBox ("This person is not present")
-
End If
-
End Sub
The query (qry) is a parameter query, with the Parameter query criteria (for the "ID" field): [Enter ID]. What I want is to display a msgbox telling whether the person is present in the database or not, after having launched a parameter query prompting the user to provide an ID (which is to be checked against the IDs already present in the database).
Nevertheless, when launched, the query do fire but there seems to be a problem with the first If statement line (If [BUSQUEDA PACIENTES].[HISTORIA] Is Not Null Then). What is the problem here?
Best regards!