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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running a macro

Status
Not open for further replies.

chickie1

Technical User
Jun 7, 2003
1
CA
I want to perform a find in my database on a "Work Order Number". The user will click on a button which switches to a new view asking them to input the "Work Order Number" they are looking for......how do I creat a macro to run a message IF NO MACHING "WORK ORDER NUMBERS" ARE FOUND....I dont have a problem creating a message but I'm having a problem with the IF statement for IF NO WORK ORDERS ARE FOUND (then do this or do that).....and when I choose "Find and wait for input" I am unable to choose the "when no records are found run macro" option.......Can anyone help me with this procedure????

Thanx
 
1. Create a variable field, named vWONum say, option same data type as the w/o # field.

2. Create a named find using the content of the variable field as the condition. In Browse, on a form based on the table to be searched, from the menu: Create | Named Find/Sort | New | View. Click in the w/o number field and type =@vWONum as the condition. Hit Enter, type a name for the find and OK out.

3. Use the macro Find command to run the named find. This gives you an option of running another macro if no records are found. This macro can contain the Message command.

You can put the variable field on the form for the operator to enter the w/o number and attach the macro to a button to run the find. You can also make the variable field a fieldbox and list created from the w/o number field.

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

Part and Inventory Search

Sponsor

Back
Top