history
Egyptian Pharaoh
- Local time
- Today, 04:43
- Joined
- Jan 26, 2008
- Messages
- 190
Hello Brothers,
I have a form that requires serial no to enter the database
this serial no is depending on the HD serial no after calculation
but no way to enter.
The code I'm using On Click event on the form:
The Code in the module:
waiting your help
I have a form that requires serial no to enter the database
this serial no is depending on the HD serial no after calculation
but no way to enter.
The code I'm using On Click event on the form:
Code:
If (Me.HardiskSerialNo.Value - 479277050#) = Me.txtSerialNo1.Value _
And (Me.HardiskSerialNo.Value - 479277200#) = Me.txtSerialNo2.Value _
And (Me.HardiskSerialNo.Value - 479277180#) = Me.txtSerialNo3.Value _
And (Me.HardiskSerialNo.Value - 479277150#) = Me.txtSerialNo4.Value Then
DoCmd.Close
DoCmd.OpenForm "frmUserLogon"
Else
MsgBox "Sorry the Registration Code is not valid." & vbCrLf & "The program will be terminated." & vbCrLf & "Try to contact the Programmer.", vbOKOnly + vbMsgBoxLeft + vbCritical, "Failed"
DoCmd.Quit
End If
Code:
Sub ShowDriveInfo()
Set fs = CreateObject("Scripting.FileSystemObject")
Set H = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName("D:")))
'Don't forget to put the drive you want to assign the serial no to
Forms!KHEPRE!HardiskSerialNo.Value = H.SerialNumber
If (Forms!KHEPRE!HardiskSerialNo.Value - 479277050#) = Forms!KHEPRE!txtSerialNo1.Value _
And (Forms!KHEPRE!HardiskSerialNo.Value - 479277200#) = Forms!KHEPRE!txtSerialNo2.Value _
And (Forms!KHEPRE!HardiskSerialNo.Value - 479277180#) = Forms!KHEPRE!txtSerialNo3.Value _
And (Forms!KHEPRE!HardiskSerialNo.Value - 479277150#) = Forms!KHEPRE!txtSerialNo4.Value Then
DoCmd.Close
DoCmd.OpenForm "frmUserLogon"
Else
MsgBox " Please prove that you're authorized to use the program by registering your version "
End If
End Sub
waiting your help