I want the following code to run when the database opens the first form as the database is loaded
Dim dbCurrent As Database
Dim rstQuery As Recordset
Dim strResponse As String
Set dbCurrent = OpenDataBase("SoundinMotion.accdb")
Set rstQuery = dbCurrent.OpenRecordset("qryalerts", dbOpenSnapshot)
Do Until rstQuery.EOF
strResponse = MsgBox("ATTENTION, ToDo Action No. " & [Todo_ID] & " is overdue", , "ToDo Reminder Overdue")
rstQuery.MoveNext
Loop
However, when the form opens I get the "Type Mismatch" error message on the Set rstQuery line.
I have copied this from the Access Help file 'Recordset Object', but using my own data names.
The query qryAlerts works just fine in stand-alone mode. using Access 2007 with XP
regards
Roger