'Set Computer Name & Computer Login Name.
Dim ComputerLoginName As String
Dim Luser As String
Dim sSQL As String
ComputerLoginName = txtuserid
Luser = ComputerLoginName
sSQL = "INSERT INTO tblKey (Luser) VALUES & ('" & ComputerLoginName & "'))"
If sSQL <> "" Then CurrentDb.Execute sSQL, dbFailOnError 'ERROR
Dim pCoName As Property, pPresetReg As Property, pUserKeyInReg As Property, pUserKeyInCoName As Property
Dim db As DAO.Database
Set db = CurrentDb()
With db
'check to see if already defined
Set pCoName = .Properties("LKCompanyName")
Set pPresetReg = .Properties("LKPresetReg")
If pCoName.Value <> txtCompanyName Or pPresetReg.Value <> txtRegistrationCode Then
MsgBox "Invalid Registration Code. Please Contact the Developer.", vbExclamation
DoCmd.quit
Else
Set pUserKeyInReg = .Properties("LKUserKeyInReg")
pUserKeyInReg.Value = txtRegistrationCode
Set pUserKeyInCoName = .Properties("LKUserKeyInCompany")
pUserKeyInCoName.Value = txtCompanyName
MsgBox "You have successfully register this software", vbInformation
DoCmd.Close acForm, "frmRegister"
End If
End With
End Sub
You do not have the required permissions to view the files attached to this post.
I abandoned this code Hans, it is too complicated for me. It is not my code so I am writing my own. I still have errors with some of it and will post back later.