Results 1 to 4 of 4
  1. #1
    adamk1906 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    2

    Exclamation Editing a specific textbox depending on a number

    Hi,

    Essentially I want to edit a specific textbox depending on a number which is dependent on a number of things and varies each time the form is run.

    For example, if the number is 0 I want to edit tb0.value. If it's 1 I want to edit tb1.value etc. I have specifically labelled my text boxes in this way.


    I thought something like this would work

    textBoxName = "tb" & number
    textBoxName.value = "this is the value I want to enter".

    However, this does not work and it produces an error saying 'Invalid Qualifier'.

    Please help.

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Try

    Me("tb" & number) = your value
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    adamk is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    2
    Perfect Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problemo. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 05-02-2013, 02:10 AM
  2. Replies: 5
    Last Post: 09-20-2012, 11:34 AM
  3. Continuing Number Textbox
    By alyon in forum Access
    Replies: 6
    Last Post: 07-12-2011, 08:07 AM
  4. Replies: 4
    Last Post: 07-07-2011, 06:34 PM
  5. Getting #Number ! on addition of 5 textbox
    By Grooz13 in forum Forms
    Replies: 0
    Last Post: 08-18-2010, 07:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums