Great Idea! But where do you put the registartion key?....How does the
whole thing work.
Thanks
DS
I have static table that doesn't use an ID for the PK. I added an
Autonumber field, to generate the record numbers, then changed it to a Number
field (allow duplicates).
I then added code that would advance a specific record number each time the
system started, and a second number was advanced each time test file was
created, and a third as a control number.
The check code looks something like this: (This is for usage)
Under FormOpen
If [ControlNumber] = 1111 and [FirstNumber] >= 1234 Then
[ButtonOpenProgram].enabled = False
msgbox "You have reached the maximum number of uses, without registering
this program. If you wish to continue use this product, please purchase a
Registration Code."
Else
End If
When they plug in a registration code, change the ControlNumber to some
number other than 1111.
For the registration code, I give 10 digit alpha-numeric codes, but only
worry about specific places. I use a Case statement to verify the code is
correct. Example:
Dim string1 As String
Dim string2 As String
string1 = Mid(Text0, 2, 1)
string2 = Mid(Text0, 9, 1)
Select Case string1
Case "K", "F", "E", "k", "f", "e"
Select Case string2
Case "6", "7", "8"
DoCmd.RunSQL ("update [ControlTable] set [ControlNumber] = 11111
where [ControlNumber] = 1111;")
DoCmd.Close acForm, "frmStartup"
DoCmd.OpenForm "frmStartup"
DoCmd.Close acForm, "subfrmReg"
Case Else
MsgBox "Invalid Registration Code. Please re-enter."
Text0 = ""
Text0.SetFocus
End Select
Case Else
MsgBox "Invalid Registration Code. Please re-enter."
Text0 = ""
Text0.SetFocus
End Select
End If
Since most everything is controlled by code, the final mde file hides what I
have done. The only way to really find the key is to compare the ID number,
and see which records have changed. But even that never shows them the
Control Number, because the Control Number doesn't update until the product
is registered.
Sharkbyte