Hello,
I have an issue whereby i want to be able to present the user with a text box in which they can either enter a client id (numeric) or a client name (string) which will then form the filter on an underlying query for a form.
I have entered the following code on the <afterupdate> trigger of the text box and when the user selects a client id it works fine and opens the desired form showing the filtered result of the client id entered. But when the user enters a string value an "enter parameter" pop up appears - if the string is re-entered in this box the form will open with the desired filter in place. What do i need to do in order to have the string value work seamlessly as the numeric value does.
Dim strText As String
If IsNumeric(ctlSearch) Then
strText = "ClientID = " & ctlSearch
Else
strText = "Surname = " & ctlSearch
End If
DoCmd.OpenForm "frmEdit_Clients", , , strText
Thanks,
Alan
I have an issue whereby i want to be able to present the user with a text box in which they can either enter a client id (numeric) or a client name (string) which will then form the filter on an underlying query for a form.
I have entered the following code on the <afterupdate> trigger of the text box and when the user selects a client id it works fine and opens the desired form showing the filtered result of the client id entered. But when the user enters a string value an "enter parameter" pop up appears - if the string is re-entered in this box the form will open with the desired filter in place. What do i need to do in order to have the string value work seamlessly as the numeric value does.
Dim strText As String
If IsNumeric(ctlSearch) Then
strText = "ClientID = " & ctlSearch
Else
strText = "Surname = " & ctlSearch
End If
DoCmd.OpenForm "frmEdit_Clients", , , strText
Thanks,
Alan