You have a DO...LOOP in the first button click.
So once you click, it keeps using the same input and goes straight up to 500 without allowing any new input.
Your process map says (I paraphrase) 'take an input, store it, see what the effect would be if you add it to the current running total, do something in response.'
So you need an input text box , a text box or label to show 'running total', and a way of saying 'sorry folks, no entry' if processing the input would get you over 500 people.
----------------------------------------------------------------------------
In the Form Load event (so this happens once per run)
set the RunningTotal variable to 0
---------------------------------------------------------------------------
In the Button Click event:
, take the value from the text box [....use Val(TextBox1.text)]
and store it in a variable called (eg) nThisPartySize
If RunningTotal + nThisPartySize > 500 then
'Display a message refusing entry
Else
RunningTotal = RunningTotal + nThisPartySize
end if
----------------------------------------
...and thats probably all you need...
Enter your message below
Sign in or Join us (it's free).