Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link an Access Table to Excel 1

Status
Not open for further replies.

gautammalkani

Technical User
Sep 29, 2003
51
US
Hi All

How do I link an access table to Excel. I want the user to input a userid and password (that is currently hardcoded) and compare it to the ids and passwords in MS Access before allowing the user to submit the data. Any suggestions will be much appreciated. Thanks for your help.

Gautam

PS. As shown below, this is the username & password code that just verifies it for one case.

Private Sub submitbutton_Click()
' When the userlogs on, if is username and password are correct
' a confirmation message is displayed otherwise an
' error message pops up
' in both events, the usernames and passwords are
' reset so that the user must log on each time
' in order to send information to P&G

UserForm1.Hide

If (Username.Text = "malkani.gr@pg.com") And (password.Text = "portal123") Then
UserForm1.Hide
confirmation = MsgBox("Your data is now being uploaded", vbOKOnly, "Confirmation", "DEMO.HLP", 1000)
Username.Text = ""
password.Text = ""
Pub
Else
error_message = MsgBox("LDAP Login Failure!!!!", vbOKOnly, "No such userid for this password", "DEMO.HLP", 1000)
Username.Text = ""
password.Text = ""
UserForm1.Show
End If


End Sub
 
Gautam,

One suggestion is to use ADO to connect to the Access database and query the table containing usernames and passwords. If the returned recordset is empty then there was no match and your code would display the error message; otherwise, process the data.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top