P
PaleRider
Hi,
I have code that will close my "GlassWare" form after 14 days have passed.
For some reason when I try to close the form with code I get a different
error depending on which module the code is located OnOpen, OnLoad, ect. The
line of code that's causing the errors is the one that closes the form. If I
remove that one line, everything is fine.
Here's the code:
Private Sub Form_Open(Cancel As Integer)
Dim myDate As String
myDate = #6/2/2009#
If DateDiff("d", myDate, Date) >= 14 Then
MsgBox "Your 14 day evaluation period has expired."
End If
' This line of code causes the error
DoCmd.Close acForm, "GlassWare", acSaveNo
End Sub
I have code that will close my "GlassWare" form after 14 days have passed.
For some reason when I try to close the form with code I get a different
error depending on which module the code is located OnOpen, OnLoad, ect. The
line of code that's causing the errors is the one that closes the form. If I
remove that one line, everything is fine.
Here's the code:
Private Sub Form_Open(Cancel As Integer)
Dim myDate As String
myDate = #6/2/2009#
If DateDiff("d", myDate, Date) >= 14 Then
MsgBox "Your 14 day evaluation period has expired."
End If
' This line of code causes the error
DoCmd.Close acForm, "GlassWare", acSaveNo
End Sub