[AccessD] Form instances (AXP)

Neal Kling nkling at co.montgomery.ny.us
Wed Apr 16 07:05:17 CDT 2003


Charlotte,

I only used the .caption as an example.  The point is that you cannot
reference multiple forms in the Forms collection by name.  If you try
to, you can only see the properties of the first one.

The fact that you can still reference them by ordinal number is exactly
what I'm trying to say.

Neal Kling
Lotus, isn't that some kind of fancy flower?


-----Original Message-----
From: Charlotte Foust [mailto:cfoust at infostatsystems.com]
Sent: Tuesday, April 15, 2003 4:23 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Form instances (AXP)


When you use For Each frm in Forms, you're iterating through the members
of the collection of open forms and you're going by index rather than by
name.   That's the equivalent of Forms(0), Forms(1), etc., not
Forms("frmMyForm"), although you're free to address them using the
numeric index ... if you know which one you need. <VBG>   Why would you
expect the caption to give you meaningful results?  That is not a
difference in the name of the form, and anyhow you aren't looking for a
different form, you just want a particular instance of that form; so if
you can create a key that will get you there, why not use it?   

Charlotte Foust

-----Original Message-----
From: Neal Kling [mailto:nkling at co.montgomery.ny.us] 
Sent: Tuesday, April 15, 2003 11:04 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Form instances (AXP)


Sure, in our own collection, but that's not the Access Forms collection,
which by the way does add a reference to the multiple forms, but all the
instances of the same form share the same name.

So, while we can't use Debug.Print Forms("frmMyForm").Caption and expect
to get meaningful results, we can use 'For Each frm In Forms....'

Neal Kling
Lotus, isn't that some kind of fancy flower?


-----Original Message-----
From: Charlotte Foust [mailto:cfoust at infostatsystems.com]
Sent: Tuesday, April 15, 2003 2:27 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Form instances (AXP)


Actually, you could use the name plus an incremental number as the key
when you add the item to the collection, but it is natural that you
can't address it the conventional way if you have multiple instances
open.

Charlotte Foust

-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] 
Sent: Tuesday, April 15, 2003 5:18 AM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] Form instances (AXP)


Thanks Neal. I have ADH 97. I'll try and wrestle it off my colleague!!

-----Original Message-----
From: Neal Kling [mailto:nkling at co.montgomery.ny.us] 
Sent: 15-Apr-2003 14:01
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Form instances (AXP)


I adapted code from ADH that worked well.  Basically you declare a form
variable as Form_MyForm and work with it.  They use a collection to hold
pointers to the instances of a form and code to add and remove items
from the collection.
 
The one hitch that I quickly hit was that you can't reference your form
by name, in other words you can't use Forms!MyForm.
 
If you don't have ADH I could probably put something together for you.
 
Neal Kling
Lotus, isn't that some kind of fancy flower?

-----Original Message-----
From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk]
Sent: Tuesday, April 15, 2003 8:41 AM
To: AccessD (AccessD at databaseadvisors.com)
Subject: [AccessD] Form instances (AXP)



Hi all 

Does anyone know where there is any documentation on opening multiple
instances of a form? I can't find anything in the help file or on MSDN.

TIA 

Roz 

_______________________________________________
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
_______________________________________________
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