DanWallace
Registered User.
- Local time
- Yesterday, 19:40
- Joined
- Dec 5, 2008
- Messages
- 40
Hi there,
I have a long function that checks for errors in a series of tables. Basically I'm using one recordset to step through my tables and check for errors and one recordset to update my error report table. I'll usually populate my first recordset with something like this:
and then I go on to count and modify the results with a Do While Not rsTable.EOF().
This works fine as long as the field names are all correct. But if someone were to modify a fieldname, my function would then loop forever and crash the database. This is no good.
Is there a way that I can check to see if the recordset got any results or is there a better way of doing this that I'm overlooking?
I have a long function that checks for errors in a series of tables. Basically I'm using one recordset to step through my tables and check for errors and one recordset to update my error report table. I'll usually populate my first recordset with something like this:
Code:
strSQL1 = "SELECT table1.[field1], table1.[field2], table1.[field3] FROM tablename WHERE (conditional check for errors here)"
Set db1 = CurrentDb
Set rsTable = db1.OpenRecordset(strSQL1)
and then I go on to count and modify the results with a Do While Not rsTable.EOF().
This works fine as long as the field names are all correct. But if someone were to modify a fieldname, my function would then loop forever and crash the database. This is no good.
Is there a way that I can check to see if the recordset got any results or is there a better way of doing this that I'm overlooking?