Hope someone can help. The attached code works fine however I am having problems with the Error part. The data is numerical and should non numerical data be placed in the search box it gives up the correct message EXCEPT when a non numerical charachter is placed first in the string. ie 123rt4 gives up coerrect error message, e2345 does not. what I get instead is an input box requesting a parameter. Any ideas.
Private Sub cmdFind_Click()
On Error GoTo Error_CmdFindAnError
Dim answer As String
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Prisoner_Details"
answer = InputBox("Enter the Spin Number you wish to search for", "Find on Spin")
If Trim(answer & "") <> "" Then
stLinkCriteria = "spin=" & answer & ""
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_CmdFind:
Exit Sub
Error_CmdFindAnError:
MsgBox "You've have not entered a Number. " _
& "Spin Number is Numerical!.", vbOKOnly, "Error"
Resume Exit_CmdFind
End Sub
Private Sub cmdFind_Click()
On Error GoTo Error_CmdFindAnError
Dim answer As String
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Prisoner_Details"
answer = InputBox("Enter the Spin Number you wish to search for", "Find on Spin")
If Trim(answer & "") <> "" Then
stLinkCriteria = "spin=" & answer & ""
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_CmdFind:
Exit Sub
Error_CmdFindAnError:
MsgBox "You've have not entered a Number. " _
& "Spin Number is Numerical!.", vbOKOnly, "Error"
Resume Exit_CmdFind
End Sub