Help me make a Macro

A

Aamer

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
 
K

KARL DEWEY

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top