Allowing command button to open Find menu item.

D

Dedren

I am very close to figuring this out but I have gotten stuck. I created a
find button in a main form with 2 subforms with it that I want to act EXACTLY
like the find button in the menu. I can easily enough get the find dialog
box to open up but in the Look In field it displays only one control instead
of the entire forms name. The following is the on_click code I am using.

Private Sub Search_Click()
Screen.PreviousControl.SetFocus
RunCommand acCmdFind
End Sub

The problem with this is that it sets the 'Look in' field to either, the
'entire database', which is not searchable or to ONE control on the form
usually the first one on the Tab List. But I want it to search all controls
on the form, preferably by setting the 'look in' field to searching the
current form. I would appreciate any help.
 
Top