Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Passing a flag between forms

Posted on 2011-09-11
3
Medium Priority
?
357 Views
Last Modified: 2012-05-12
My application has a data entry form with a “RETURN” command button that unloads the form and returns the user to the main “dashboard”.

Before those actions are allowed to execute, the data is sanity checked. I do this by showing a form frmSanityCheck that performs five sanity checks and displays the results on-screen. I have a public boolean variable bSanity that is set to “True” if the data passes the sanity checks, “False” otherwise.

Data Entry Form;

Sub cmdReturn_Click()
frmSanityCheck.Show
If bSanity = True Then
Unload Me
End If
End Sub

Open in new window


Sanity Check Form:

Sub Form_Load()
	bSanity = True
‘---
‘--- do the checks
‘--- possibly setting bSanity = False
‘---
End Sub

Sub cmdReturn_Click
‘ Returns to Data Entry Form
Unload Me
End Sub

Open in new window


Question: How does the cmdReturn sub in the Entry Form know to wait for frmSanityCheck to unload before checking the value of bSanity?

Is there a better way to do this?


0
Comment
Question by:NormaPosy
[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
3 Comments
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 36520797
If you when you load frmSanityCheck you load it modally with frmSanityCheck.Show vbModal, nothing can be done until that form is unloaded.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 36520803
That should have said

If when you load frmSanityCheck...
0
 

Author Closing Comment

by:NormaPosy
ID: 36520865
Thank you so much.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

609 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