PC Review


Reply
Thread Tools Rate Thread

Creating a Multi-User Login

 
 
swlaw
Guest
Posts: n/a
 
      3rd Dec 2009
I am trying to create a multi-user login. When I create this in a 'sample'
database it works fine. I create three forms and one login form with the
appropriate VB code. No problems, I can add as many users as I want in the
code.

The problem is when I try to create the exact same login, same code, in my
actual database, for some reason it does not work. I checked all the names
and so on but cannot seem to get it to work.

Any suggestions for something I may be doing wrong.
Please help.

This a portion of the code:

Private Sub Login_Current()
Username.SetFocus
If Username = "user1" And Password = "user1" Then
MsgBox "Access Granted", vbInformation, "JMS"
MsgBox "Welcome", vbInformation, "JMS"
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Else
MsgBox "Please re-enter your Username and Password."
End If
End Sub
 
Reply With Quote
 
 
 
 
Philip Herlihy
Guest
Posts: n/a
 
      3rd Dec 2009
"Does not work" can mean an awful lot of things. Forgive me for being lazy,
but my response to this is very like one I posted just a couple of days ago.
If you'd like to have a look here:
http://bit.ly/7ixMqh
.... you may find it leads you to a solution.

Phil, London

"swlaw" <(E-Mail Removed)> wrote in message
news:E90B22B0-F5B0-4E52-BB6A-(E-Mail Removed)...
> I am trying to create a multi-user login. When I create this in a 'sample'
> database it works fine. I create three forms and one login form with the
> appropriate VB code. No problems, I can add as many users as I want in the
> code.
>
> The problem is when I try to create the exact same login, same code, in my
> actual database, for some reason it does not work. I checked all the names
> and so on but cannot seem to get it to work.
>
> Any suggestions for something I may be doing wrong.
> Please help.
>
> This a portion of the code:
>
> Private Sub Login_Current()
> Username.SetFocus
> If Username = "user1" And Password = "user1" Then
> MsgBox "Access Granted", vbInformation, "JMS"
> MsgBox "Welcome", vbInformation, "JMS"
> DoCmd.Close
> DoCmd.OpenForm "Switchboard"
> Else
> MsgBox "Please re-enter your Username and Password."
> End If
> End Sub


 
Reply With Quote
 
swlaw
Guest
Posts: n/a
 
      3rd Dec 2009
Does not work, means that when I log in it is suppose to go to a form. Seems
pretty simple but I am having a hard time? Any suggestions.

"Philip Herlihy" wrote:

> "Does not work" can mean an awful lot of things. Forgive me for being lazy,
> but my response to this is very like one I posted just a couple of days ago.
> If you'd like to have a look here:
> http://bit.ly/7ixMqh
> .... you may find it leads you to a solution.
>
> Phil, London
>
> "swlaw" <(E-Mail Removed)> wrote in message
> news:E90B22B0-F5B0-4E52-BB6A-(E-Mail Removed)...
> > I am trying to create a multi-user login. When I create this in a 'sample'
> > database it works fine. I create three forms and one login form with the
> > appropriate VB code. No problems, I can add as many users as I want in the
> > code.
> >
> > The problem is when I try to create the exact same login, same code, in my
> > actual database, for some reason it does not work. I checked all the names
> > and so on but cannot seem to get it to work.
> >
> > Any suggestions for something I may be doing wrong.
> > Please help.
> >
> > This a portion of the code:
> >
> > Private Sub Login_Current()
> > Username.SetFocus
> > If Username = "user1" And Password = "user1" Then
> > MsgBox "Access Granted", vbInformation, "JMS"
> > MsgBox "Welcome", vbInformation, "JMS"
> > DoCmd.Close
> > DoCmd.OpenForm "Switchboard"
> > Else
> > MsgBox "Please re-enter your Username and Password."
> > End If
> > End Sub

>
> .
>

 
Reply With Quote
 
Philip Herlihy
Guest
Posts: n/a
 
      3rd Dec 2009
I wonder if the DoCmd.Close is closing the form whose module may turn out to
contain the code you're running, so it never gets to the DoCmd.OpenForm.

However, without using error handling code and setting breakpoints I'm only
guessing. My suggestion was and is that you add error-handling, learn how
to use breakpoints and how to step through code. Not hard, and all there in
Help!

Phil

"swlaw" <(E-Mail Removed)> wrote in message
news:BB6F8241-CEEE-49AE-8FA3-(E-Mail Removed)...
> Does not work, means that when I log in it is suppose to go to a form.
> Seems
> pretty simple but I am having a hard time? Any suggestions.
>
> "Philip Herlihy" wrote:
>
>> "Does not work" can mean an awful lot of things. Forgive me for being
>> lazy,
>> but my response to this is very like one I posted just a couple of days
>> ago.
>> If you'd like to have a look here:
>> http://bit.ly/7ixMqh
>> .... you may find it leads you to a solution.
>>
>> Phil, London
>>
>> "swlaw" <(E-Mail Removed)> wrote in message
>> news:E90B22B0-F5B0-4E52-BB6A-(E-Mail Removed)...
>> > I am trying to create a multi-user login. When I create this in a
>> > 'sample'
>> > database it works fine. I create three forms and one login form with
>> > the
>> > appropriate VB code. No problems, I can add as many users as I want in
>> > the
>> > code.
>> >
>> > The problem is when I try to create the exact same login, same code, in
>> > my
>> > actual database, for some reason it does not work. I checked all the
>> > names
>> > and so on but cannot seem to get it to work.
>> >
>> > Any suggestions for something I may be doing wrong.
>> > Please help.
>> >
>> > This a portion of the code:
>> >
>> > Private Sub Login_Current()
>> > Username.SetFocus
>> > If Username = "user1" And Password = "user1" Then
>> > MsgBox "Access Granted", vbInformation, "JMS"
>> > MsgBox "Welcome", vbInformation, "JMS"
>> > DoCmd.Close
>> > DoCmd.OpenForm "Switchboard"
>> > Else
>> > MsgBox "Please re-enter your Username and Password."
>> > End If
>> > End Sub

>>
>> .
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi user login Deepak Microsoft Access 2 19th Jun 2009 04:41 PM
Multi User Login Deepak Microsoft Access Getting Started 8 18th Jun 2009 03:18 PM
login forms for multi user db on shared server david.nixon@ubs.com Microsoft Access Forms 2 19th Jun 2006 06:21 PM
Creating a multi-user spreadsheet Steve Microsoft Excel Programming 3 25th Aug 2004 01:18 PM
Secure multi user login for Windows 98se Freeware 1 25th Sep 2003 02:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:20 AM.