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!

eof problem on parameter query

Status
Not open for further replies.

HLotis

Programmer
Dec 14, 1998
31
US
Hi,

Step 1
I have a set of 4 queries(author, title, subject, media)any one of which underlies a form/subform. The user selects which underlying query he wants to use by selecting one of the 4 from a list in a combo box.

Upon selection, the subform's SourceObject is set to the name of the chosen query. The subform is then automatically refreshed based on the chosen query.

Step 2
Next, the user can select specific records from the chosen query. This is based on the user responding to a prompt and filling in a parameter value from the user such as(specific author, part of a title,subject,etc)
Suppose the user responds with a value that is NOT contained in the table/query, like xyz.
The result is that Access presents a blank record which is beyond the last record.

I want to give a message to the user that the value was not found and move to the the last/first record.

How do I check for eof ? I cannot open it as rst ahead of time, nor do I know what filenumber it is after the user picks one.

How do I determine what the filenumber is if I did not assign it one ?

Harry.Lotis@mms.gov
 
Before presenting thr results set to the yser, check the recordcount property of the results. If it is zero, change the unerlying quert parameters to something else, which has the alternate results you wnat the User to see.

Also, yuo should 'play nice' here and give the user an alert that 'his' choice was not found, and that 'he' is looking at something else.

Alternatively, you could make sure this cna't happen by setting the parameter(s) to selections derived from the recordsource. This is usualy done via list/combo boxes.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Thanks for the idea on the count of records.

The combo box allows for keywords to be used in Title searches and for the first letter or so of Author names or Subject names. Users can choose any author/subject. If none are found, then I give directions to manuall show all records by having the user choose to resort the data by author/title, etc. Since I did not use filters per se, I cannot release the filter by showallrecords.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top