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

Unwanted prompt for parameter when opening form 1

Status
Not open for further replies.
Oct 24, 2002
512
US
I want to prompt the user for a purchase order number (using an inputbox) then open the form for that specific purchase order. My inputbox works and the correct purchase order is opened but I get a second prompt for the parameter FindPO.

How can I set the Where clause of DoCmd.OpenForm to use the value for FindPO that the user entered in the inputbox?

Dim FindPO As String

FindPO = InputBox("Enter the PO #", "Bionetics PO System")
DoCmd.OpenForm "frmPO", , , "PONumber=FindPO"


Ann
 
FindPO = InputBox("Enter the PO #", "Bionetics PO System")
DoCmd.OpenForm "frmPO", , , "PONumber=FindPO"

Should be
FindPO = InputBox("Enter the PO #", "Bionetics PO System")
DoCmd.OpenForm "frmPO", , , "PONumber='" & FindPO & "'"
 
Ace, you're an angel for giving me the help I needed so quickly. Of course, it works perfectly now. I still get confused about those darned single and double quotes.

Ann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top