D
David via AccessMonster.com
Need help fast!...
How can I pass the equivalent of an OpenArgs value to a multiple-instance
form when adding it to a collection?
Here is the code used to add the form to the collection (to create the
newest instance of the form):
----
Private mcolContactDetailForms As New Collection
Private Sub Combo0_AfterUpdate()
Dim frmDet As Access.Form
Static d As Long
d = d + 1
Set frmDet = New Form_frmContactDetails
With frmDet
.Caption = "Contact Details " & d
.Visible = True
.Filter = "pkautContactID = " & Me.Combo0
.FilterOn = True
.Tag = "Forms!frmContactLookup!Combo0|Det"
End With
mcolNewContactForms.Add frmDet, frmDet.Caption
End Sub
----
I'm no expert on this procedure...it was adapted from an ACCESS ADVISOR
article (www.msaccessadvisor.com, "Create Multiple Copies of a Form").
What I need to do is have the value that I put in the Tag used in the Open
event of the form. However, none of the properties set here are put into
effect on the form until after it is Opened, Loaded, Activated, etc. And
you can't set the OpenArgs value here because it is read-only.
So, how can I pass a string to the new form for use on its Open event?
Thanks in advance!
David
How can I pass the equivalent of an OpenArgs value to a multiple-instance
form when adding it to a collection?
Here is the code used to add the form to the collection (to create the
newest instance of the form):
----
Private mcolContactDetailForms As New Collection
Private Sub Combo0_AfterUpdate()
Dim frmDet As Access.Form
Static d As Long
d = d + 1
Set frmDet = New Form_frmContactDetails
With frmDet
.Caption = "Contact Details " & d
.Visible = True
.Filter = "pkautContactID = " & Me.Combo0
.FilterOn = True
.Tag = "Forms!frmContactLookup!Combo0|Det"
End With
mcolNewContactForms.Add frmDet, frmDet.Caption
End Sub
----
I'm no expert on this procedure...it was adapted from an ACCESS ADVISOR
article (www.msaccessadvisor.com, "Create Multiple Copies of a Form").
What I need to do is have the value that I put in the Tag used in the Open
event of the form. However, none of the properties set here are put into
effect on the form until after it is Opened, Loaded, Activated, etc. And
you can't set the OpenArgs value here because it is read-only.
So, how can I pass a string to the new form for use on its Open event?
Thanks in advance!
David