Code error

  • Thread starter Thread starter Kay
  • Start date Start date
K

Kay

Hi
I have created a reminder for my project using a table with the fields,
alarm id, alarm time and message. Iv used the following code to check
each record to see if the alarm time matches the current time. I am
getting an error with the line
"Set rs = Me.RecordsetClone". The error is "Type Mismatch"

Dim rs As Recordset

Set rs = Me.RecordsetClone
With rs
Do Until .EOF
.MoveFirst
If Me.[AlarmDate] = Date And Me.[AlarmTime] <= Time() And
Me.[Reset] = False Then
MsgBox ("A Job is Due") & vbCrLf & _
("ALARM ID = ") & AlarmID & vbCrLf & ("ALARM MESSAGE = ") &
AlarmMessage & vbCrLf & ("Please tick the reset box on the alarm form
to reset the alarm")
End If
.MoveNext
Loop
End With
Set rs = Nothing

Has anyone any idea why this could be, your help is very much
appreciated.
 
Kay,

I have not looked at the rest of your code, but only the lines that you say
you are having a problem with. The question here is were are you trying to
use the recordsetclone? Is this being done in a form with an attached record
source?
 
Back
Top