Search Button on form

Troogroove

Registered User.
Local time
Today, 12:51
Joined
Dec 11, 2006
Messages
10
I am trying to add a search to a form, which will search the DB and then return the result to the form.

A previous DB that is beign retired soon has this function and works, so i thought I would just copy the code behind the button.

Code:
    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 [\code]

Any way the button does what it needs to but the look in box does not list the table. It only shows the form name and the current filed selected when the search button is pressed.

My new form is set up with the same properties as the old one.

Anyone had this one before??

Thanks
 
Why not filter the form? Or is this form unbound?
 
The Form is bound to the DB, and it just shows 1 record at a time. All the fields are bound to the corresponding parts of the DB, so the username box is bound to the username field in the table.
 
What I've done for a search on my form is to have a combo box to pick the name I'm looking for and then use the filter, as Keith suggests, to narrow the focus to that record. I then have another button to restore the form to the unfiltered state.
 

Users who are viewing this thread

Back
Top Bottom