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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open report and where string ?

Status
Not open for further replies.

ooops

MIS
Dec 21, 2000
91
US
I have a report which has control source from myTable. Then I have a form with 1 textbox for users to enter the jCode they want to search for. (jCode in my table is not a primary key. My primary key is an auto number)
On the form I have button cmdSearch.

Private Sub cmdSearch_Click()

DoCmd.OpenReport "report1", acViewNormal, , "[txtJCode] = " & Me.txtJCodeSearch

End Sub

Everytime I click button cmdSearch, I got a parameter window asking for txtJcode. This is not supposed to happen. What did I do wrong ? I even enter the jCode again in the parameter window but nothing happens after that. It doesn't open my report at all.

Thanks
 
need to send parameter text in quotes

DoCmd.OpenReport "report1", acViewNormal, , "[txtJCode] = '" & Me.txtJCodeSearch & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top