Solved

multiple forms

Posted on 2002-03-18
2
167 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 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