Username & Password

mike30x

Registered User.
Local time
Today, 20:46
Joined
Apr 16, 2008
Messages
35
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??????:eek:

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:
Simple Software Solutions

When you digitally do you mean with a pen/tablet and if so what is the purpose behind the logic.
 
When you digitally do you mean with a pen/tablet and if so what is the purpose behind the logic.

The story is i enter a user name and password which then loads a .bmp created using a tablet pc (dont have the cash to have multiple tablets or smaller pads at the moment).

So if michael comes along select his name then keys in his password his signature will appear on the form (like magic). I got the username and password sorted i think included in the last post just need to get the signature to appear.
 
Last edited:
Simple Software Solutions

Add am image control to the form and set it to stretch.

In the users table have an extra field that holds the path and file name of the bmp file for each employee.

Once the users password has been validated add the following code

Code:
Me.Signature.Picture = StrSignature

Where Me.Signature is the name of the image control and StrSignature is the path and file name of the bmp file.


CodeMaster::cool:
 
Thanks for that never would have thought of the stretch for the image. How should i insert this into the orginal code so that it is validated only by the correct username and password.
 
Simple Software Solutions

At the point in your code where you validate the users name and their password.

It loos like the user can either pick their name for a combo box or type in their user name into a text box. The use of the combo box reduces security. However in the RowSource property add an extra column in the underlying query which will be the field that contains the path to the signature bmp.

Rowsource = Select UserName,Id,Signature From Users Order By Username
ColumnWidths = 3cm,0cm,0cm

In the above example you have three columns 0 - 2


Then on the OnClick Event of the ComboBox enter the following

Code:
Me.TxtSignature = Me.ComboBox.Column(2)

Where Column 2 is the column that contains the path name.
And Me.TxtSignature is the name of the image control


CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom