Hello,
Hope someone help me out.
When I open the form I got error:
"compiler error: User-defined type not defined." then I added reference "microsoft DAO 3.6 object library". the error is gone.
But when I click the form's buttom, I got error:
"Run-time error 13, Type mismatch"
The following are my codes:
Private Sub Form_Open(Cancel As Integer)
Dim db As Database, rst As Recordset, dt As Variant
Set db = CurrentDb
Set rst = db.OpenRecordset("Temp_Cal_30"
'(mismatch here)
dt = CDate(rst.Fields("30Date"
)
If rst.RecordCount > 0 Then
rst.MoveFirst
If dt < Now() Then
AppendDatesMo
End If
ElseIf rst.RecordCount = 0 Then
AppendDatesMo
Else
End If
End Sub
Thank you very much for your kind help.
Jing
Hope someone help me out.
When I open the form I got error:
"compiler error: User-defined type not defined." then I added reference "microsoft DAO 3.6 object library". the error is gone.
But when I click the form's buttom, I got error:
"Run-time error 13, Type mismatch"
The following are my codes:
Private Sub Form_Open(Cancel As Integer)
Dim db As Database, rst As Recordset, dt As Variant
Set db = CurrentDb
Set rst = db.OpenRecordset("Temp_Cal_30"
dt = CDate(rst.Fields("30Date"
If rst.RecordCount > 0 Then
rst.MoveFirst
If dt < Now() Then
AppendDatesMo
End If
ElseIf rst.RecordCount = 0 Then
AppendDatesMo
Else
End If
End Sub
Thank you very much for your kind help.
Jing