login screen

shrive22

Board Regular
Joined
Jun 10, 2002
Messages
120
I have a login screen where a user enters a 3 digit number in a text box and then clicks login button. after they click login button I want to check the number they typed in against valid employee numbers in my employee table to see if they can login. Does anyone know if this is possible? i think it might involve a sql statement but im not sure.

Thanks for the help
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
This is what I have so far but it does not work:

Private Sub logincmd_Click()
usertxt.SetFocus

If usertxt.Text = "Select Emp_no From Employee Where Emp_no = " & usertxt.Text Then
On Error GoTo err_cust_click
Dim strdocname As String
Dim strlinkcriteria As String

X = usertxt.Text
strdocname = "DocsDue"
DoCmd.OpenForm strdocname, , , strlinkcriteria

Exit_cust_click:
Exit Sub
err_cust_click:
MsgBox Err.Description
Resume Exit_cust_click
ElseIf usertxt.Text = "" Then
MsgBox "Please enter a valid user name.", vbOKOnly, "Login Error"
End If


End Sub
 
Upvote 0

Forum statistics

Threads
1,221,547
Messages
6,160,450
Members
451,647
Latest member
Tdeulkar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top