Greetings,
what you need to do is to open the popup form in dialog mode (which is
probably already the case). In the popup form you need to add a public
property (Get) and assign it the desired value. Note: a form is just a
class module except that it has a graphical user interface (GUI - the
GUI thing happens way under the hood for Access).
In the popup you can create a public property anywhere in the Form's
code module (not a standard module or standalone class module). In my
sample I am setting a Certification property to a Long datatype. If
your Certification is a string, then set the property to String
'--code for popup form
Public Property Get Certification() As Long
Certification = CLng(txtCertifi cation.value)
End Property
Private Sub cmdOK_Click()
Me.Visible = False
End Sub
In the popup form here I have a textbox called txtCertificatio n. A user
enters information here then clicks an OK button (cmdOK) which only
hides (Me.Visible = False) the form (don't unload the form - it has to
be running so that you can read the value from its property). In the
calling form you would call the popup like this:
'--code for main form
Private Sub Command3_Click( )
On Error Resume Next
DoCmd.Openform "frmPopup", acNormal, , , , acDialog, "test123"
Debug.Print Forms("frmPopup ").Certificatio n
End Sub
You can also pass a value to the popup using the openArgs property.
Here I pass "test123" to the popup. You can read the value in the popup
Load event
Private Sub Form_Load()
txtCertificatio n = Me.OpenArgs
End Sub
Rich
*** Sent via Developersdex
http://www.developersdex.com ***