By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Custom Log-in screen

P: n/a
Thanks in advance for any clues here. I'm designing a simple user
log-in for a relatively low-security app that I don't want to go
through workgroups, etc. I have a login screen with a combobox to
select a user then a text box for them to put in their password. I have
a separate table set up with just the user name and the passwords as
fields. How can I write code on my log-in form to compare their name
and password entered. DLookup? Any code known that I could put in the
event for pressing the log-in button to accomplish this?
Thanks! Dav

Oct 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Parasyke" <kr************@yahoo.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Thanks in advance for any clues here. I'm designing a simple user
log-in for a relatively low-security app that I don't want to go
through workgroups, etc. I have a login screen with a combobox to
select a user then a text box for them to put in their password. I have
a separate table set up with just the user name and the passwords as
fields. How can I write code on my log-in form to compare their name
and password entered. DLookup? Any code known that I could put in the
event for pressing the log-in button to accomplish this?
Thanks! Dav
Assuming your form is bound to the table, something like (untested):

Dim rs as DAO.Recordset, strCriteria as String
strCriteria = "[NameField] = " & Me.cboName
Set rs = Me.RecordsetClone
With rs
.FindFirst strCriteria
If ![PasswordField] = Me.txtPassword Then
'Let them in
Else
'Don't let them in
End If
End With

rs.Close
Set rs = Nothing

You might want to base your combo box on "[NameField]" so that you don't
have to handle the NoMatch situation.

HTH - Keith.
www.keithwilby.com

Oct 30 '06 #2

P: n/a
For low level security apps, I'd recommend just getting the windows
login name. You can create a new module, add the code from here:
http://www.mvps.org/access/api/api0008.htm and then use the
fOSUserName function to determine user name and security on your own
table.
Chris Nebinger
Parasyke wrote:
Thanks in advance for any clues here. I'm designing a simple user
log-in for a relatively low-security app that I don't want to go
through workgroups, etc. I have a login screen with a combobox to
select a user then a text box for them to put in their password. I have
a separate table set up with just the user name and the passwords as
fields. How can I write code on my log-in form to compare their name
and password entered. DLookup? Any code known that I could put in the
event for pressing the log-in button to accomplish this?
Thanks! Dav
Oct 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.