Results 1 to 3 of 3

Thread: Text Box number as a variable

  1. #1

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Text Box number as a variable

    Hello All,

    Is it possible to have a For/Next loop for Text Box numbers?

    I tried the following code but I get a error message:
    "Object variable or with block variable not set".

    Code:
    Private Sub Form_Load()
    Dim a As Integer
    Dim texta As TextBox
    
    For a = 1 To 2
    texta.text = 2
    texta.text = 4
    Next a
    
    
    End Sub
    Any ideas.

    Regards
    Tarablue

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member Tarablue's Avatar
    Join Date
    Feb 2007
    Location
    Somewhere West of GMT
    Posts
    398

    Re: Text Box number as a variable

    Hello RhinoBull,

    Thank you for that. I just realised that my coding should be attached to a Command Button and NOT in the Private Sub Form_Load() area, but the error I got was the same. Your code seems to work OK so I'll try it in my main program and see how I get on.

    Regards
    Tarablue

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