Solved

multiple forms

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

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

Suggested Solutions

Title # Comments Views Activity
How to create a duplicate finder Application 9 120
Spell Check in VB6 13 112
vbModal 12 51
Sub or Function is not defined 6 25
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

816 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

8 Experts available now in Live!

Get 1:1 Help Now