Help me make a Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

have a form in my access 2003 database on which i embedded a "find

record button". when i clik on this button a window opens asking

What to Find:

Look in: Search Form

Match: (options are: Whole Field, Any Part Of Field, Start of Field)

Search: (options are: All, Up, Down)


.. It works fine when i select "Any Part Of Field".

the code for the above is:

Private Sub Find_Record_Click()
On Error GoTo Err_Find_Record_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Find_Record_Click:
Exit Sub

Err_Find_Record_Click:
MsgBox Err.Description
Resume Exit_Find_Record_Click

End Sub



what i need is to crate a macro where I enter the value to be searched and
it finds that in Any Part Of Field in the querry. in this macro i do not need
to make a selection (Whole Field, Any Part Of Field, Start of Field) it just
looks up in the whole querry and give result.




Thanks
Aamer Sheikh
 
Why not just put the prompt as criteria in the query like this --
Like "*" & [Enter search data] & "*"

This will find what is entered in any part of the field or if you just press
ENTER it will pull all records.
 
Back
Top