Results 1 to 3 of 3

Thread: [RESOLVED] populating the control name from a variable

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    23

    Resolved [RESOLVED] populating the control name from a variable

    hi,

    How do I explain this.. I have a form where the user enters in upto 49 values. I need to get the last 3 values entered.

    example user polulates textboxes 1 to 6 (called text1,text2,text3,text4,,etc) with the values a,b,c,d

    I need to pass the last 3 entered values (d,c,b) to another form. My plan was to get the txt.name of the last entered textbox (the textboxes are in order). Then I get the name and subtract 1 and the result is the name of the variable that I need to get the .Text value of.

    I can get the txt.name, I can get the new name of the field I need to look up, but I cannot pass this string to the control to get the control.text value.

    Maybe I am going about this the wrong way..any comments would be great.

    thanks

    Anne

  2. #2
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    468

    Re: populating the control name from a variable

    To reference a control by name, use the form's Controls array:

    Form1.Controls(NameOfControl).Text

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    23

    Resolved Re: populating the control name from a variable

    Bpd, its so easy when you know...thanks a million

    Anne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width