G
Guest
Opening a modal form causes the code to stop until that
form closes, so you don't have to do anything else -- just
make certain the form you open is, as you note, "popup"
and "modal".
Larry Linson
Microsoft Access MVP
other databases to provide common used functions. I would
like to use a form from the Helper Functions database to
send info into the referencing database but I cannot halt
the execution of the calling vb code in order to get data
from the form. The basic scenario is this:
Buttons. 3. The user selects an option and presses
Ok/Cancel.
the 'User Choice Form" until that point it is Null
pressed the Ok or Cancel button on the User Choice Form as
at present the code simply runs straight through and uses
the default Null for the GlobalReturnValue and I am unable
to do anything with it.
form closes, so you don't have to do anything else -- just
make certain the form you open is, as you note, "popup"
and "modal".
Larry Linson
Microsoft Access MVP
as 'Helper Functions' which I import as a reference into-----Original Message-----
Hi,
I have a series of modules in a database that I use
other databases to provide common used functions. I would
like to use a form from the Helper Functions database to
send info into the referencing database but I cannot halt
the execution of the calling vb code in order to get data
from the form. The basic scenario is this:
the user to make a choice. This form has Ok & Cancel1. User presses a button in Parent database
2. Form from the Helper Function database opens allowing
Buttons. 3. The user selects an option and presses
Ok/Cancel.
that is assigned when the user presses Ok or Cancel in4. The selection made is returned to the Parent database.
5. The returned value is then used in further code.
Code is something like:
' in Parent database
Sub ShowUserChoice()
Dim thisValue as Variant
' Get The User's Input
thisValue = GetUserChoice()
' Use the User's Input
MsgBox "Selected: " & thisValue
End Sub
and
' in Helper Functions database
Function GetUserChoice() as Variant
DoCmd.OpenForm "User Choice Form"
**
GetUserChoice = GlobalReturnValue
End Function
The 'GlobalReturnValue' is a global variable (Variant)
the 'User Choice Form" until that point it is Null
the user makes their choice and to resume when they haveI want to be able to pause at the point marked ** whilst
pressed the Ok or Cancel button on the User Choice Form as
at present the code simply runs straight through and uses
the default Null for the GlobalReturnValue and I am unable
to do anything with it.