Solved

multiple forms

Posted on 2002-03-18
2
165 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 While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

856 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