Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data retrieval using the FIND button

Status
Not open for further replies.

tonyA1DL

Technical User
Feb 11, 2003
32
GB
to access database records 95% of the time we search on a 6-digit URN field and have to:

- mouse & click FIND button
- mouse & click "URN" field
- key 6-digit URN
- mouse & click OK button
- found set is displayed

I want to simplify this to a macro, for example

- press assigned function key
- key 6-digit URN
- press ENTER
- found set is displayed

I am struggling with the macro, ...help please!
 
Create a variable field and under options, give it the same data type as the URN field. Say it's named vURN

Create a named find on the view using the variable field. In Browse, from the menu, Create - Named Find/Sort - New - View. Click in the URN field and enter the condition:

=@vURN

Hit Enter, type a name for the find and OK out.

You put the variable field on the form, enter the # then click a button or function key to run the macro. The macro Find command will run the named find.

Paul Bent
Northwind IT Systems
 
Thanks Paul, I still can't get it to work though!

what should the macro look like?
I'm having difficulty with getting it to find, await the user keying the 6 digit URN in the URN field.

Should the vURN field records be filled to match the URN field en mass?

Tony
 
No, you've created a named find. vURN is a variable field that holds a single value to find on. The field isn't part of the dbf table

All the user does (in Browse) is enter the URN in the variable field then click a macro button to run the find. The macro:

Macro1
Run If(IsBlank(vURN)) run Macro2 else end
Find using named find.... if no records found run Macro3

Macro 2
Message Please enter a URN number to find.

Macro3
Message No records found

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top