Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Question, Release one form and load another form

Status
Not open for further replies.

VBFOXDEV35

Programmer
Mar 26, 2001
77
US
All:

Here is a simple for question. I have 2 forms, a password verification form, which is called from the main program menu bar. And a data entry form. Once the user logs in, I want the password form to release and then have the data entry form to load. What is the easiest way to go about this?

I have tried to DO FORM "form_name" to variable but one cannot do that from within the form.

Also if I try to do this as a procedure:
FUNCTION OpenForm
PARAMETERS strNewForm
IF strNewForm <> &quot; &quot; THEN
DO FORM &strNewForm.
ELSE
RETURN
ENDIF
RETURN

but the user can then go to another form after they leave form two.

Any ideas?

Thanks all

Art


Art DeGaetano II
Software Developer, MOUS
 
VBFOXDEV35

Use this SKIP FOR clause in your menu and if the user is sucessfull make a variable .t. and if not make it false, that way the menu selection will not be available. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Actually the menu is not the problem, I want to be able to load the password form. Then if successful, unload the password form and then load a data entry form.

This is what I need to figure out how to do. I must have not been clear to what I was asking.

Art
Art DeGaetano II
Software Developer, MOUS
 
VBFOXDEV35

What is the problem? Can you re-explain?
[ol][li] You have a logging form. No menu a this point.[/li]
[li] In the valid of the textbox, you can whether the user had successfull login and if he did, you load the menu allowing him the access the data entry form, otherwise, kick him out, no?[/i]

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Nevermind all I just figured it out.

Here is what I did:


PARAMETERS pstrAction, pstrItem
LOCAL pstrReturn
SET PROCEDURE TO &gstrFishDir.\Lib\libclas.app ADDITIVE
DO CASE
CASE pstrAction = &quot;PROGRAM&quot;
DO &pstrItem.
** do the form that was first called.
CASE pstrAction = &quot;FORM&quot;
DO FORM &pstrItem. to pstrReturn
** if a return form is needed then call the procedure
IF pstrReturn <> &quot; &quot; then
DO openform WITH pstrReturn
ELSE
RETURN
ENDIF
ENDCASE
RELEASE PROCEDURE &gstrFishDir.\Lib\libclas.app
RETURN

***********************************************************
FUNCTION OpenForm
PARAMETERS pstrForm
LOCAL pstrReturn
** open the new instance of the form.
DO &gstrFishDir.\Lib\libclas.app WITH &quot;FORM&quot;,pstrForm
CLEAR PROGRAM
RETURN


Let me know what you all think, plus is this method safe??

Art
Art DeGaetano II
Software Developer, MOUS
 
I have an application that does this same thing.

What I do is this:

In the main startup program, I have this:

DO FORM LOGIN.SCX NAME LOGIN
READ EVENTS

to run the login form. The login form contains text boxes for the login name and password.

When the login name and password are entered, the &quot;Submit&quot; button becomes active. When it is clicked, I issue:

DO FORM DATA.SCX NAME DATA
THISFORM.RELEASE

That runs the data entry form and releases the login form.


Hope this helps...

Allen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top