Anda di halaman 1dari 1

Create a form with the fields for input. Have a button to start the search and another to exit.

With the search button, open up the property sheet and create a proc in Events for the OnClick event. Then create a filter string. Ex: Dim strF As String If not isnull(Me.Text0) Then strF = _ "[TableFld0] = '" & Me.Text0 & "' And " If not isnull(Me.Text1) Then strF = strF & _ "[TableFld1] = '" & Me.Text1 & "' And " If not isnull(Me.Text2) Then strF = strF & _ "[TableFld2] = '" & Me.Text2 & "' And " .....and etc. then remove the word And at end of filter If strF > "" THen strF = Left(strF,len(strF)-5) 'now filter or open a form/report Forms!FormToFilter.Form.Filter = strF Forms!FormToFilter.Form.Filter = True or DOcmd.OpenReport "YourReport",,,strF

Anda mungkin juga menyukai