PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Using variable as form field name

Reply

Using variable as form field name

 
Thread Tools Rate Thread
Old 12-01-2007, 02:52 AM   #1
John
Guest
 
Posts: n/a
Default Using variable as form field name


Hi

I have two fields field1 and field2 on my form. Is there a way that the
field names can be accessed via variable so that choice of the actual field
to access is decided at runtime?

Thanks

Regards


  Reply With Quote
Old 12-01-2007, 04:37 AM   #2
Spam Catcher
Guest
 
Posts: n/a
Default Re: Using variable as form field name

"John" <John@nospam.infovis.co.uk> wrote in
news:#nUS2SfNHHA.4604@TK2MSFTNGP06.phx.gbl:

> I have two fields field1 and field2 on my form. Is there a way that
> the field names can be accessed via variable so that choice of the
> actual field to access is decided at runtime?


Yes, use a recursive function to iterate through all the controls on your
form to find the control with the name.
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off