Solved

multiple forms

Posted on 2002-03-18
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Expert Comment

by:JackOfPH
ID: 6878843
please clarify your question?
0
 
LVL 1

Accepted Solution

by:
Barraza earned 50 total points
ID: 6878867
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

689 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