Barbara Ryan
BarbaraRyan at cox.net
Sat Apr 7 14:03:40 CDT 2007
Hi, Gustav.... Thanks for your reply. I forgot to mention that I am using the collection within a class. I just discovered that varValue = mfrm.Controls(i).Value seems to work. I thought I had already tried that approach --- I may have been referencing a control type not having a value property. Thanks, Barb ----- Original Message ----- From: "Gustav Brock" <gustav at cactus.dk> To: <accessd at databaseadvisors.com> Sent: Saturday, April 07, 2007 2:00 PM Subject: Re: [AccessD] Syntax for finding value of an item in a collection > Hi Barb > > Couldn't that be: > > varValue = Me.Controls(Split(colControls(1), "!")(2)).Value > or: > varValue = Forms(Split(colControls(1), > "!")(1)).Controls(Split(colControls(1), "!")(2)).Value > > /gustav > >>>> BarbaraRyan at cox.net 07-04-07 18:07 >>> > I have a collection for control names (e.g., colControls) which contains > certain controls (e.g. txtLastName) on a form (e.g. frmFormA). For > example, colControls(1) = "[Forms]![frmFormA]![txtLastName]". > > Let's say that txtLastname currently contains the name "Smith. What is > the syntax for finding the VALUE of colControls(1) , i.e., "Smith"? > > Thanks, > Barb > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com