Searching through a form (1 Viewer)

k0r54

Registered User.
Local time
Today, 02:13
Joined
Sep 26, 2005
Messages
94
Hi,

On my form i have a text box (txt_search) and a search button (cmd_search). Now when the button is pressed i want it to go to another form (that bit is done) and display the search results (the bit that is hard).

How can i get it so that when i click the button. It searches some predefined fields with the text in the txt_search once the button is clicked.

Thanks
k0r54
 

llkhoutx

Registered User.
Local time
Yesterday, 20:13
Joined
Feb 26, 2001
Messages
4,018
Build a SQL string for the recordsource of your new form, on button click event store the sql string in the form's recordsource and requery the form.

Example:

Button_Click event
docmd.openform "NewformName"
forms("NewformName").recordsource= 'your filtering sql string'
forms("NewformName").requery
forms("ActiveFormName").visible=false ' to hide it
or
docmd.close acform,"ActiveformName" 'to close it
 

Users who are viewing this thread

Top Bottom