I have a forum which will take two inputs from person and will open the form.
The table is like this
CODE
PERSON_ID VISIT_ID
1001 1
1001 2
1002 1
1002 2
1001 1
1001 2
1002 1
1002 2
When the data entry operator will give the two values, she will have another form open.
The form, which is taking these two values, has the following code.
CODE
Dim strvalue As Long
Dim strvalue1 As Long
strvalue = Me.Text0.Value
strvalue1 = Me.Text1.Value
If IsNull(DLookup("PERSON_ID", "Table", "PERSON_ID = " & strvalue & "VISIT_NO = " & strvalue1)) Then
MsgBox "Number is not there", vbCritical + vbOKOnly, "DPS Neuropatia"
Else
DoCmd.Close
DoCmd.OpenForm "Entry_form", acNormal, , _
"PERSON_ID = " & strvalue And "VISIT_NO = " & strvalue1
End If
Dim strvalue1 As Long
strvalue = Me.Text0.Value
strvalue1 = Me.Text1.Value
If IsNull(DLookup("PERSON_ID", "Table", "PERSON_ID = " & strvalue & "VISIT_NO = " & strvalue1)) Then
MsgBox "Number is not there", vbCritical + vbOKOnly, "DPS Neuropatia"
Else
DoCmd.Close
DoCmd.OpenForm "Entry_form", acNormal, , _
"PERSON_ID = " & strvalue And "VISIT_NO = " & strvalue1
End If
I am making a mistake in syntax but I don't know where. Can somebody please help me?
Thanks