Solved

multiple forms

Posted on 2002-03-18
2
158 Views
Last Modified: 2010-05-02
I am a newbie. I have the first form )all it has on it is the typical enter your login name and password) then I have a second form (which has a txt box on it that you can write to a file) I want to be able to go to the second form after verifying that the login name and password are correct. For example you run the program and enter your user name and password, you hit the ok command button, if the info is correct the second form comes up and you are able to run the program. I hope that makes more sense.
0
Comment
Question by:heather25
2 Comments
 
LVL 15

Expert Comment

by:JackOfPH
Comment Utility
please clarify your question?
0
 
LVL 1

Accepted Solution

by:
Barraza earned 50 total points
Comment Utility
Here's a simple solution..
On your Form1 (where the user types his name and password) put a Login button (Command1).

Private Sub Command1_Click()
    Username = Text1.Text
    Password = Text2.Text
    If userAuthenticated(Username, Password) = True Then
        Form2.Show 'Shows your second form, your Main form
        Unload Form1 'Hides the form used to login
    Else
        MsgBox "Bad Username or Password"
    End If
End Sub

Function userAuthenticated(Username, Password) As Boolean
    'Write code in here to check if the
    'Username and Password are valid
End Function
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now