Results 1 to 2 of 2

Thread: Using a button to add 1 to a counter....

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    Using a button to add 1 to a counter....

    Haven't used vb in years so sorry for the rustyness here.
    I'm using a form to display excel data. I'm taking multiple fields across one row and displaying them in textboxes. When I reference the cells I want to use a counter to replace the row index as in..
    textbox1.text = cells(counter, 1)

    I then need a button that will add 1 to that counter so it will essentially take me to the next record. Any help will be greatly appreciated....

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    under the button to move to next row
    VB Code:
    1. if clng(txtBox.Text)+1 <65535 then
    2.     txtBox.text = clng(txtBox.Text)+1
    3. end if

    txtBox is the textbox controls name...

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

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