Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cash book - compare values visually 1

Status
Not open for further replies.

Thingol

Technical User
Jan 2, 2002
169
0
0
Hi all,

I am making a simple cash book for my own administration. I structured the input of data like this:
______________
| |
| Receipt data | Important field: Total sum on receipt.
|______________|
| 1.
|
_______?_many______
| |
| Entrees on receipt | Each with their own amounts (in €'s)
|____________________|

I hope this is a clear representation. I want to create a form in which I can enter the receipts and all the entrees on them. I want to enter a total sum of the receipt. After entering all the seperate entrees on the receipt, the sum of these entrees should add up to the same amount as the entered total sum of the receipt. I want to represent this visually. That is, I want a bar like this:
_______________________________
|////////////////////////////| |
|/////////70%//////////////| |
|////////////////////////////| |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
The percentage could also be the sum of the already entered entrees of the current receipt. The graphic should update as soon as the data in the form is updated.

Now, what I already have is a form with a subform for entering the receipt data and the entree information respectively. This all works well. I also have a query that contains the total amount of the receipt and the sum of the seperate entrees. So, the values are there. Now I want to make the graphic. I have tried doing it with a graph, but haven't yet succeeded.

Does anyone have an idea on how to tackle this one?

Any help would be greatly appreciated.
Thanks a lot in advance.

Best regards,
Martijn Senden.

In the Beginning there was nothing, which exploded.

--Terry Pratchett, Lords and Ladies--
 
Here is a couple of ideas.

On the main form create two controls, a box and a label. Align both controls to the left with the same top and height. The Box will represent 100% and the label will represent the current percentage.

Also on the main form create a
public sub setPercent( subSumAmount as currency)
dim perc as float
perc = subSumAmount / enterAmount
lblPerc.width = box.width * perc
lblPerc.caption = format( perc, "Percent")
end function

On the subform
Select the form and set the AfterUpdate event to call the parent function with the current total of entered values

Parent.setPercent sumAmount
 
Wow, thanks! With some minor adjustment that was really usable!

Best regards,
Martijn Senden.

In the Beginning there was nothing, which exploded.

--Terry Pratchett, Lords and Ladies--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top