[AccessD] Open Multiple Instances of a Form and passing a parameter

Stuart McLachlan stuart at lexacorp.com.pg
Sat Aug 4 22:52:25 CDT 2012


It you need to pass something which the form can use when opened in this way, try the Tag 
property instead.

-- 
Stuart

On 4 Aug 2012 at 20:12, Charlotte Foust wrote:

> OpenArgs isn't a property you can set.  When you open the form using
> DoCmd.OpenForm, OpenArgs is the last argument you can pass in.  The
> Form_Open event then has to check to see if it got a value in OpenArgs and
> do something with it.  So you could have something like this in the
> Form_Open event of the form:
> 
> 
> > If Not IsNull(Me.OpenArgs) Then
> >     Me.Caption = Me.Caption & " Test"
> 
>     End If
> 
> Does that help?
> 
> Charlotte
> 
> 
> On Sat, Aug 4, 2012 at 7:50 PM, Lawrence Mrazek <lmrazek at lcm-res.com> wrote:
> 
> > 'Purpose:   Open an independent instance of form frmClient.
> >     Dim frm As Form
> >
> >     'Open a new instance, show it, and set a caption.
> >     Set frm = New Form_frmMainMenu_ShipmentScheduling
> >     frm.Visible = True
> >     frm.Caption = frm.hwnd & ", opened " & Now()
> >     frm.OpenArgs = "test"
> >
> >     'Append it to our collection.
> >     clnClient.Add Item:=frm, Key:=CStr(frm.hwnd)
> >     Set frm = Nothing
> >
> > When I try to run this, I get the error: " 2135" ... This property is
> > read-only and can't be set ... pointing to the line:
> > frm.OpenArgs = "test"
> >
> > On Sat, Aug 4, 2012 at 9:41 PM, Charlotte Foust
> > <charlotte.foust at gmail.com>wrote:
> >
> > > OpenArgs should work.  What's your code look like?
> > >
> > > Charlotte
> > >
> > > On Sat, Aug 4, 2012 at 7:35 PM, Lawrence Mrazek <lmrazek at lcm-res.com>
> > > wrote:
> > >
> > > > Hi Folks:
> > > >
> > > > I've been testing the code on: http://allenbrowne.com/ser-35.html
> >
> >
> > > >
> > > > to open
> > > > multiple instances of a form in Access 2007. It works well, but I need
> > to
> > > > be able to pass some parameters on to the form I'm opening.
> > > >
> > > > OpenArgs don't seem to work.
> > > >
> > > > Any ideas?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Larry
> > > > Lmrazek at lcm-res.com
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > > >
> > > >
> > > > Website: http://www.databaseadvisors.com
> >
> >
> > > >
> > > >
> > > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > > Website: http://www.databaseadvisors.com
> >
> >
> > >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > Website: http://www.databaseadvisors.com
> >
> >
> >
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list