[AccessD] Refer to Forms as variables...

Collins, Darryl Darryl.Collins at anz.com
Mon Oct 5 17:50:11 CDT 2009


Thanks heaps Shamil and Stuart.

I am sure there is a completely logical reason for the change in syntax.
Coming from an Excel VBA background where you can pretty much stick a
variable in anywhere in the code where a fixed value works, it seems odd
to use
Such different syntax, but hey... It works :)

Cheers
Darryl. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Monday, 5 October 2009 6:26 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Refer to Forms as variables...

Hi Darryl,

Forms(gstrFormName).Controls(gstrSubForm).Form.Requery

should make "the trick" or just

Forms(gstrFormName)(gstrSubForm).Form.Requery


--Shamil


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Collins,
Darryl
Sent: Monday, October 05, 2009 8:11 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Refer to Forms as variables...

Hi All,

I know I have done this before, but now I can't seem to get it to work
right now - not much joy on Google. Bah Humbug and Grrrr. Using A2003.

This works
[Forms]![ITPMO_frmMenu_ResourcesHumans]![ITPMO_frmResources_People_].[Fo
rm].Requery

But what I want to do is this:
[Forms]![& gstrFormName & ]![ & gstrSubForm & ].[Form].Requery

Where gstrFormName = "ITPMO_frmMenu_ResourcesHumans"
And gstrSubForm  ="ITPMO_frmResources_People_"

Anyone got any pointers?

Cheers
Darryl.

 

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru
 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

"This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential,  may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."




More information about the AccessD mailing list