paulmcdonnell
Ready to Help
- Local time
- Today, 12:06
- Joined
- Apr 11, 2001
- Messages
- 167
Hi huys,
this should be so simple but its driving me mad.
My code inspects a query to see how many entries there are.
If there are non and the query is empty I need it to ignore this and move on.
as my code is this works by causing an error and i'm using the On Error Goto
(i know this is not a good way to do it but which is the best?)
code is :
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Query_Appointments Tomorrow (PRM)")
'Count the number of appointments
'if there are non then jump to update teh table and exit this code.
'On Error GoTo UpdateforPRMDiaryCheckURGENTAPPSBROADCASTEMAIL
rst.MoveFirst
Do While Not rst.EOF
counting = counting + 1
rst.MoveNext
Loop
Any ideas would be very welcome. The only one I have come up with is to abandon the saved query all together and recreate it in the code .
Hoping for the help
Paul


this should be so simple but its driving me mad.
My code inspects a query to see how many entries there are.
If there are non and the query is empty I need it to ignore this and move on.
as my code is this works by causing an error and i'm using the On Error Goto
(i know this is not a good way to do it but which is the best?)
code is :
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Query_Appointments Tomorrow (PRM)")
'Count the number of appointments
'if there are non then jump to update teh table and exit this code.
'On Error GoTo UpdateforPRMDiaryCheckURGENTAPPSBROADCASTEMAIL
rst.MoveFirst
Do While Not rst.EOF
counting = counting + 1
rst.MoveNext
Loop
Any ideas would be very welcome. The only one I have come up with is to abandon the saved query all together and recreate it in the code .
Hoping for the help
Paul