Question : How to make a simple search form

How can I do this.

I want to make two text boxes, where the user will put the two enteries from different feilds of a table. Once entered the info, the user will then click the search box or command button. It should then take the user to another form with that record. Now I can make the button and use the macro to go to that form. How can I make the first form with text box inputs and stuff.

Thanks

Answer : How to make a simple search form

If you're searching for text then you need to include a quote mark like this...

Private Sub Command1_Click()
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "FormToOpen"
    stLinkCriteria = "[Field1]='" & Me![Text1] & "' And [Feild2]='" & Me![Text2] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Random Solutions  
 
programming4us programming4us