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

Wherecondition with input parameters

Status
Not open for further replies.

luker74

Programmer
Mar 30, 2006
1
IT
Hello,
i would like to implement a wherecondition with two input parameter as conditions, my code is:

DoCmd.OpenForm "Cognome_status", acNormal, , wherecondition:="[surname] = " & InputBox("Surname") & " and [status] = " & InputBox("Status")


when i run this code it ask me two times the surname and two times the status, anyone can tell me why?

thanks
 
A starting point:
Code:
Dim strSurname As String, strStatus As String
strSurname = InputBox("Surname")
strStatus = InputBox("Status")
DoCmd.OpenForm "Cognome_status", acNormal, , "surname='" & strSurname & "' AND status='" & strStatus & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top