hey guys, i'm stuck again!
I'm learning about loops.
The exercise i'm doing wants me to enter numbers into a box (it doesn't specify what sort so i'm using a text box). It wants me to show the running total of the numbers entered into the box (this is shown in another text box box) and it wants me to keep entering numbers until the running total is 500. If 500 is exceeded then a msg box pops up.
Here's my code so far:
VB Code:
Option Explicit Dim Number As Integer Private Sub cmdOk_Click() Static Total As Integer Total = 0 Do Number = txtNumber.Text Total = Total + Number Loop Until Total = 500 txtTotal.Text = Total If Total > 500 then msgbox "Total Capacity Reached" End Sub
can you give me any pointers. i've been stuck on this for about 2.5 hours now.
thanks




Reply With Quote