I want to be able to allow people to sign (digitally) there work once they have entered all of the data. On the form i have added the text box for there name and password. Can anyone give me some basic code to start with I have already created a table tblEmployees which has EmpName and EmpPassword how do get it all to tie together??????
Managed to get this working using some code i found on the net, see below. I want to be able to add a picture when a name is selected how would i manage this ?????
'Check to see if data is entered into the Signature and Password combo box
If IsNull(Me.Combo1002) Or Me.Text999 = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.Combo1002.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.Text999) Or Me.Text999 = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.Text999.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.Text999.Value = DLookup("strEmpPassword", "tblEmployees", _
"[lngEmpID]=" & Me.Combo1002.Value) Then
lngMyEmpID = Me.Combo1002.Value
Image1005.Visible
'Close logon form and open splash screen
'DoCmd.Close acForm, "frmLogon", acSaveNo
'DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.Combo1002.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub
Managed to get this working using some code i found on the net, see below. I want to be able to add a picture when a name is selected how would i manage this ?????
'Check to see if data is entered into the Signature and Password combo box
If IsNull(Me.Combo1002) Or Me.Text999 = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.Combo1002.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.Text999) Or Me.Text999 = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.Text999.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.Text999.Value = DLookup("strEmpPassword", "tblEmployees", _
"[lngEmpID]=" & Me.Combo1002.Value) Then
lngMyEmpID = Me.Combo1002.Value
Image1005.Visible
'Close logon form and open splash screen
'DoCmd.Close acForm, "frmLogon", acSaveNo
'DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.Combo1002.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub
Last edited: