I am using the following code to simply search through a database (Jobs) with a form and open a new form (Jobs)containing the information that I search for. The problem is when I open the search form (say I enter: dog) I get a text box that says "Enter parameter value", so if I enter dog again my information will come up in the new form. But if I enter "dog" with the parenthesis around it, it works fine. I don't know how to do it without needing the parenthesis. Thanks!
Private Sub cmdLaunchTransactionReport_Click()
On Error GoTo Err_cmdLaunchTransactionReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim sCriteria
sCriteria = "[JobName]=" & txtJobName
stDocName = "Jobs"
DoCmd.OpenForm stDocName, acNormal, , sCriteria, acFormEdit
Exit_cmdLaunchTransactionReport_Click:
Exit Sub
Err_cmdLaunchTransactionReport_Click:
MsgBox Err.Description
Resume Exit_cmdLaunchTransactionReport_Click
End Sub
Private Sub cmdLaunchTransactionReport_Click()
On Error GoTo Err_cmdLaunchTransactionReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim sCriteria
sCriteria = "[JobName]=" & txtJobName
stDocName = "Jobs"
DoCmd.OpenForm stDocName, acNormal, , sCriteria, acFormEdit
Exit_cmdLaunchTransactionReport_Click:
Exit Sub
Err_cmdLaunchTransactionReport_Click:
MsgBox Err.Description
Resume Exit_cmdLaunchTransactionReport_Click
End Sub