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

Macro includes 2 'Finds'

Status
Not open for further replies.

TonyG57

Technical User
Aug 29, 2002
21
0
0
GB
Is it possible to include two 'finds' in a macro so that the second 'find' produces a listing of a sub group of records identified by the first 'find'?
My efforts seem to indicate that the second 'find', using a stored find, ignores the first, a 'and pause for user input' find and produces a list of records from the whole database rather than just from the first 'find'.
 
After the first find, use Find Again and wait for input to add further conditions. Note you must create the first (named) find on the view, not with the Find Asst, if you wish the user to enter further conditions on the view and not into the Asst.

Paul Bent
Northwind IT Systems
 
Paul - many thanks for your prompt reply but, as a relative beginner using Approach, I do not seem able to incorporate your suggestions into my macro.

My current macro reads as follows:

View - Switch to Find Banking
Find - & pause for input ( on the Find Banking form, user selects a banking batch number from the drop-down list for the PAYTS database)
Find - using stored find 'balpd' (a basic find looking for records in the PAYTS database with the letter 'b' as the first letter in the Notes field
View - switch to mailing label 8
Print preview

I shall be grateful if you could set out how I should amend my macro to fit your suggestion. When I tried to amend it myself by inserting a 'Find - Again and pause for input' after the first 'Find - & pause for input', I seemed to be stuck on the first view into which the user had already inserted the banking batch reference so there was no opportunity to invoke the stored find mentioned in my macro above

Your suggestion continues:
'Note you must create the first (named) find on the view, not with the Find Asst, if you wish the user to enter further conditions on the view and not into the Asst.'

I was confused by this as my first find is not a named find but by user input. Also I do not understand how to 'create the . . . . . find on the view' - or on which view.

As you will see from my macro above, I was trying to minimise input by the user. Is it not possible to invoke the stored 'balpd' find automatically once the user has selected the banking batch reference and pressed Return?

I am sorry I have to ask you to assist me further but can assure you your help is very much appreciated.

Many thanks

TonyG57
 
No you can only do it the other way round, run a named find first then let the user find again.

A find (except a find on a find distinct) always searches all records.

So you need to incorporate both finds into one. Create a variable field for the user to enter the batch number and set it up as a drop down list. Say you named it vBatch. On the form in Browse, from the menu, Create - Named Find/Sort - New - View. Click in a field that belongs to the database to be searched and enter a text formula, substituting your own table and field names, as the find condition that evaluates to True/False, eg:

If(PAYTS.BatchNum = vBatch and Left(PAYTS.Notes, 1) = 'b')

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

The user will select a batch # in the variable field then click a button to run a macro that runs the named find.

Paul Bent
Northwind IT Systems
 
Thank you again Paul. I have printed out your reply and will have a look at it again tomorrow (Sunday). Here in the UK it is getting rather late in the day for heavy programming so, after a good night's sleep, I will see what I can do and let you know how I get on.

There are obviously many more facilities in Approach than are mentioned in 'Building Databases in Approach 3" by Elaine Marmel which was the only book on the subject I could find in the UK.
 
Try "Using Lotus Approach 96" by Sue Sloan, recently reprinted and available from the XpertSS Store at There have been so few feature changes in the six years since 96 was released that the book is equally relevant to the latest version.

I assume you aren't using V3 because you said you used a named find. V3 is an old 16 bit release that was superceded by 96 when Windows 95 came out. 96 is very different to V3 so I guess your book is a bit baffling at times!

Paul Bent
Northwind IT Systems
 
Many thanks again for your help - I am nearly there.
The good news is I have managed to get my macro working and it produces the mailing labels for one banking batch reference. The bad news is that I can only produce a report for one batch reference per session as I need something in my macro to clear the selected batch reference and variable value before exiting the macro otherwise the next time I run it, it users the current information held and so goes straight to the print preview without waiting for any user input. I can only print out another set of receipts by exiting from Approach and restarting which clears the variable. Setting a variable default value did not seem to help.
There is another minor problem in that running the Find/sort initially produces an error message reporting that no records can be found by my macro ( presumably because no values have been entered) . On responding by hitting the OK button, the form appears allowing the user to select a batch reference.

My macro now reads as follows:

View - Find Binbanking (allows user to select the variable batch reference. The find/sort text is hidden on the View in a dummy field I added to the database just for this purpose. The user then hits the 'find' button which runs the find/sort )
Find - using stored find findbalbybkg (this follows your suggestion exactly)
View - switch to mailing label
Print Preview

I appreciate your help which has basically solved my problem but shall appreciate any further assistance you can give to clear the two final problems.
I have ordered the book you recommended - many thanks for the advice. I am using the Millenium edition of Approach so there are a few changes from version 3.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top