Cummulative total in Userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an userform with 12 lines of 3 text boxes (36 textboxes total)

The first textbox in the line looks up for a costumer name and places a
balance in the third textbox. The second textbox holds a payment that reduces
the balance (third textbox). I got that part taken care of.

My problem arises when I try to validate several data entry scenarios: the
same costumer making several payments, (up to 12) either in consecutive order
or not and being able keep the running balance and place it in the 3rd text
box of the respective line.
Any suggestions?
 
give the textboxes names that identify their function, location and are
conducive to looping through

for i = 1 to 12
set tbox = me.Controls("bal" & i)
' perform necessary calculations

next i
 
Thank you for the prompt response.
I think I wasn't clear enough.
I'm invisioning different scenarios, like customer1 in the first row needs a
running balance, then in line two costumer 2 needs a separate balance, then
in line three costumer 2 again, then in line 4 costumer1 again, I have to be
able to compute the current balance. The code has two identify any
reocurrance of the same client and keep the balance running.
 
I guess it is me that isn't being clear.
Naturally you will have to write the code to perform the functionality you
want. That is what writing code is all about.

I showed you a good way to loop through your controls. Within that loop or
multiple loops you write the complex code that is required to examine the
controls and make decisions.
 
I got it. Thanks a lot.

Tom Ogilvy said:
I guess it is me that isn't being clear.
Naturally you will have to write the code to perform the functionality you
want. That is what writing code is all about.

I showed you a good way to loop through your controls. Within that loop or
multiple loops you write the complex code that is required to examine the
controls and make decisions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top