Private Sub Form_Open(Cancel As Integer)
Dim CPU As String
Dim Kontrol As String
CPU = GetWmiDeviceSingleValue("Win32_Processor", "ProcessorID")
mtn_urunkimligi = CalculateMD5(CPU)
GCPU = CalculateMD5(mtn_urunkimligi)
Kontrol = Nz(DLookup("[Kimlik]", "tbl_lisans", "[lisanskodu]=" & "'" & GCPU & "'"), 0)
If Kontrol > 0 Then
DoCmd.Close acForm, "frm_lisans"
DoCmd.OpenForm "frm_kullanicigiris", acNormal, "", "", , acNormal
Else
DoCmd.GoToRecord acForm, "frm_lisans", acNewRec
End If
End Sub
Yazan kod bloğunda If Kontrol > 0 Then ile lisans kontrolü yapıyor. Eğer Kontrol değeri 1 den büyük ise lisanslı demek ve frm_kullanicigiris isimli formu açıyor. Eğer Kontrol > 0 değilse lisans penceresini açıyor. Bu kontrolü diğer formlarda da yapabilirsiniz.