Disable Db - Have partial code from DCrake

WineSnob

Not Bright but TENACIOUS
Local time
Today, 17:35
Joined
Aug 9, 2010
Messages
211
I fouond this code from DCrake in the forum and it references GetCustomProp. I would like to try this code out but need the function GetCustomProp. Any ideas where I can find it?

Here is the code referencing GetCustomProp

Private Sub Form_Open(Cancel As Integer)
Dim ExpiryDate As Date
Dim UnlockCode As String

ExpiryDate = GetCustomProp("Date completed")

If DateDiff("d", Now(), ExpiryDate) < 0 Then
' if the software has already been unlocked once then don't give the option again
If IsNull(GetCustomProp("Telephone Number")) = False Then
MsgBox "License expired. Please contact Supplier to unlock this software."
DoCmd.RunCommand acCmdCloseDatabase
Exit Sub
End If

' if it hasn't then ask for unlock code
UnlockCode = InputBox("Your license to use this software has expired. Please contact Supplier to renew your license. If you have an unlock code please enter it here:")
If UnlockCode = "PADLOCK" Then
SetCustomProp "Date completed", Format(DateAdd("d", 7, Now()), "dd/mm/yyyy")

CreateCustomProp "Telephone number", dbText, "11111111" ' existence of this custom prop indicates the software has already been unlocked once and can't be unlocked again
MsgBox "Software unlocked. Your license has been renewed for 7 days."
Exit Sub
Else
MsgBox "No code / incorrect code entered. Please contact Supplier."
DoCmd.Close
Exit Sub
End If
End If

ExpiryDate = GetCustomProp("Date completed")

' warning if getting near expiry date
If DateDiff("d", Now(), ExpiryDate) < 14 Then
MsgBox "Warning, this software will expire in " & DateDiff("d", Now(), ExpiryDate) & " days. Contact Supplier to renew your license."
End If


End Sub
 
Thanks. That is helpful but I would still like to get the rest of DCrake code
GetCustomProp
 

Users who are viewing this thread

Back
Top Bottom