Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with a search

Status
Not open for further replies.

skip49401

Technical User
Mar 18, 2003
3
US
Hello,
I am trying to search a text field in a query. I use the code below, whenever I put the search criteria in the text box another box will pop up that says "Enter the parameter value", so I have to reenter the same search criteria and then it works. If I originally enter the search criteria with parenthesis around it, it works great, with no second box popping up. It's like it doesn't understand that it is text unless I put parenthesis around it.

Private Sub cmdLaunchTransactionReport_Click()
On Error GoTo Err_cmdLaunchTransactionReport_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim sCriteria
sCriteria = "[JobName]=" & txtJobName
stDocName = "rptTransactions"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria
Exit_cmdLaunchTransactionReport_Click:
Exit Sub
Err_cmdLaunchTransactionReport_Click:
MsgBox Err.Description
Resume Exit_cmdLaunchTransactionReport_Click
End Sub
 
Run the query the report is based on. Does it ask you to enter a parameter when you do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top