Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Vb

Options
  • 19-11-2002 10:19am
    #1
    Registered Users Posts: 446 ✭✭


    sorry its early...
    Its a vb program and theres 3 buttons...
    Confirm-Next-Calculate

    the confirm button just adds the name and address etc and prints it out. then when the person presses this button I need it to say "X people are enrolled in this college".

    I've tried different ways but only the Do While loop works.

    Works in the sense that it adds 1 but obviously the user cant use the rest of the program until the loop has finished and then when the 2nd user, uses the program the loop has stopped.


Comments

  • Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,723 Mod ✭✭✭✭yop


    Kate

    Have me lost on this one.

    User: Presses NEXT - adds name and address etc. Then displays message "1 person enrolled in college"

    So they press NEXT again and it adds name and address etc.
    Message "2 people enrolled in college"

    So what do you want to happen next?


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by kegan5
    Works in the sense that it adds 1 but obviously the user cant use the rest of the program until the loop has finished and then when the 2nd user, uses the program the loop has stopped.
    I'm not certain what your question is, as English does not appear to be your first language, but from what I read, what you might be looking for is a call to:
    DoEvents
    


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    DoEvents wont solve that problem.

    However, my sneaky suspicious brane tells me that this sounds ominously like a college project :)

    So....why dont you post what you have, and we can see what you're doing wrong. Much easier...

    jc


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by bonkey
    So....why dont you post what you have, and we can see what you're doing wrong. Much easier...
    He posted this issue to three threads; here as well as here and here.

    His/her problem appears to be with regard to basic variable scope in VB.


  • Registered Users Posts: 935 ✭✭✭Mixie


    If I read that right you're just trying to get the number of 'students' you've already entered... why not keep a counter as you go along?
    Dim Counter As Integer

    Private Sub cmdConfirm_Click()

    'do something

    Counter = Counter + 1
    MsgBox Counter & " people are enrolled in this college", vbOKOnly + vbInformation, "Student information"

    End Sub


    or if you were using , e.g. a listbox , you could do:
    MsgBox (Listbox.ListCount - 1) & " people are enrolled in this college", vbOKOnly + vbInformation, "Student information"

    Any help?


  • Advertisement
  • Registered Users Posts: 446 ✭✭kegan5


    I already said it was an assigment thats y i didnt want to put whole code up... I was just looking for help on a loop.

    Thanks


Advertisement