Activating, Deactivating code based on reg code simulation

pat_nospam

Registered User.
Local time
Today, 15:52
Joined
Oct 14, 2003
Messages
151
I have some trial code that counts down 30 days before the application will no longer function. What I would like to do is put a button that pops up a message box asking for a "registration code". If that code is entered, the code that runs the 30 day countdown is disabled.

Any pointers on how to activate/deactivate code based on a hard coded entry (i.e. (if # = number.stored then Code is permanently disabled))

Thanks in advance,

Pat
 
I would create a function to process this...

First create a table with only one record for the registration code. Give the record a default value of say "000000000".

Whenever a user opens up the app you could check against a function.

Public Function chkRegCode() As Boolean

Dim db as DAO.Database
Dim rec As DAO.Recordset
Dim strSQL as String
Dim myValidCode as String


myValidCode = "123456789"
strSQL = "SELECT myRegCode FROM tblRegCode"

Set db = currentDb
Set rec = db.OpenRecordset(strSQL)

Select Case rec("myRegCode")

Case Is = "123456789"
chkRegCode = True
Case Else
chkRegCode = False
End Select

rec.close
Set rec = Nothing
Set db = Nothing

End Function



Then at the point of checking just call the function

Select Case chkRegCode()
Case Is = True
' Valid reg code already in table
Case Is = False
' No valid reg code in table
End Select


Hope this helps
 
dan-cat, you do realise we have [CODE] [/CODE] tags, don't you. Much easier to read than your customised green. ;)
 
Mile-O-Phile said:
dan-cat, you do realise we have [CODE] [/CODE] tags, don't you. Much easier to read than your customised green. ;)

Don't make me angry you wouldn't like me when I'm ANGRY :p
 

Users who are viewing this thread

Back
Top Bottom