I intend to issue a trial version of my software. I have a table, tblRegistry, that I want to contain the installation date, and the length of the trial period.
My frmRegistry has qryRegistry as it's record source. This query calculates the number of days remaining by calculating the difference between today's date and the installation date and subtracting that from the trial period.
The problem that I have is setting the installation date the first time the software is opened. The frmRegistry is opened via my autoexec macro everytime the software is opened. Here is my code for the OnOpen Event:
Private Sub Form_Open(Cancel As Integer)
If IsNull(Forms!frmRegistry!InstallationDate) Then
Me.InstallationDate = Date
Else
' Forms!frmRegistry!DaysRemaining = Forms!frmRegistry!TrialPeriod - (Now() - Forms!frmRegistry!InstallationDate)
If Forms!frmRegistry!DaysRemaining = 0 Then
MsgBox "Your trial period has expired" & vbCrLf & _
"Please call (801) 680-2943 to purchase your copy of IMS Software", vbOKOnly, "Expiration of Trial Period"
DoCmd.Quit
End If
End If
End Sub
When I run this code, I get a runtime error #-2147352567 (80020009) "You cant assign a value to this object.
What am I missing?
My frmRegistry has qryRegistry as it's record source. This query calculates the number of days remaining by calculating the difference between today's date and the installation date and subtracting that from the trial period.
The problem that I have is setting the installation date the first time the software is opened. The frmRegistry is opened via my autoexec macro everytime the software is opened. Here is my code for the OnOpen Event:
Private Sub Form_Open(Cancel As Integer)
If IsNull(Forms!frmRegistry!InstallationDate) Then
Me.InstallationDate = Date
Else
' Forms!frmRegistry!DaysRemaining = Forms!frmRegistry!TrialPeriod - (Now() - Forms!frmRegistry!InstallationDate)
If Forms!frmRegistry!DaysRemaining = 0 Then
MsgBox "Your trial period has expired" & vbCrLf & _
"Please call (801) 680-2943 to purchase your copy of IMS Software", vbOKOnly, "Expiration of Trial Period"
DoCmd.Quit
End If
End If
End Sub
When I run this code, I get a runtime error #-2147352567 (80020009) "You cant assign a value to this object.
What am I missing?