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

RecordsetClone.Recordcount problem 1

Status
Not open for further replies.

Craig0201

Technical User
Joined
Oct 11, 2000
Messages
1,261
Location
GB
Hi........

I've got a form with a recordsource based upon two union queries. On the form_open event, the me.recordsetclone.recordcount property is checked to see if the value is 1. If the value is one then the user does not have a choice and a value from the recordset is passed back to the calling form. This is all working fine EXCEPT.....

I know that my union query is returning two values as I have checked and the me.recordsetclone.recordcount does return 2 but on the form_open event, the recordcount doesn't update quick enough (before the form_close event is called as the check is registering 1).....

Any ideas on how I can update the recordset before I check the value?? I've tried requery and refresh to no avail!

Craig
 
You have to move to the last record of the recordset to get the full count. When a recordset is first opened, if it has 0 records, you will get 0 for a .RecordCount. If it has 1 or more, you will get one. Use the .MoveLast method and then check the record count (this is the advantage of working on a clone recordset; doesn't affect your form's rst.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top