Results 1 to 5 of 5

Thread: Wow, I am an idiot

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Kentucky
    Posts
    29

    Wow, I am an idiot

    Okay, I need to know how to have an increment stop in a certain event. Let me explain. I have 5 variables, A - E. I also have variable F. All of them are integers. Well, I set a command button to increment A - E, and decrease that amount from F. A - E have their own command button, but all subtract from F. Well, when F = 0, I dont want them to be able to increment A-E or or subtract from F anymore.

    I did this 2 years ago with the help of my friend, and now that I am in class I decided to restart the project. Unfortunatly, I forgot how to do this easy little step. Anyone give me some advice...? Ya dont have to tell me how, just point me in the right direction... heh.

  2. #2
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    Well..in the method where you increment A-E and decrement F, just place a check before that where If F= 0 Then Exit Sub..or you could disable the command buttons when F reaches 0..there are several ways you could do this
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Disable the 'subtract' button when F= 0.

    eg. cmdSubtract.Enabled = False

  4. #4
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    VB Code:
    1. cmdSubtract.Enabled = (F <> 0)
    would do the trick...
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Kentucky
    Posts
    29
    Thank you

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