T
Todd
I have a search feature on a main form where a user will enter a incident
number and it will bring up the record in a different form in order to edit
the data. When I try to use the feature, it will only provide the "Please
Enter a Valid Incident Number". The text box that I am using to enter the
value is called txt_incidentnum
Below is the code I am using. Can anyone see some stupid mistake I made?
Dim strwhere As String
Dim stDocName As String
If Me.txt_incidentnum > 0 Then
strwhere = "IncidentNo=" & Me.txt_incidentnum.Value
stDocName = "frm_DataEntry"
DoCmd.OpenForm stDocName, , , strwhere
Else
MsgBox "Please Enter a Valid Incident Number", vbExclamation, "Error"
Exit Sub
End If
Thanks
number and it will bring up the record in a different form in order to edit
the data. When I try to use the feature, it will only provide the "Please
Enter a Valid Incident Number". The text box that I am using to enter the
value is called txt_incidentnum
Below is the code I am using. Can anyone see some stupid mistake I made?
Dim strwhere As String
Dim stDocName As String
If Me.txt_incidentnum > 0 Then
strwhere = "IncidentNo=" & Me.txt_incidentnum.Value
stDocName = "frm_DataEntry"
DoCmd.OpenForm stDocName, , , strwhere
Else
MsgBox "Please Enter a Valid Incident Number", vbExclamation, "Error"
Exit Sub
End If
Thanks