|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Help with a Sum Problem
Okay so I have a form, this form has multiple entries. All are numbers. I want to total these into a box at the bottom of the form. I had it working but tried something else and lost it now I can not find it again.
This should be simple but I can not figure it out. Thanks for your help, I sure need it.
__________________
We bring the images on the Museum Walls into your retail store. |
|
#2
|
|||
|
|||
|
me.txtbox3 = me.txtbox1 + me.txtBox2
I sure you want more then that, but without more info... S- |
|
#3
|
||||
|
||||
|
Were do I place that code?
|
|
#4
|
|||
|
|||
|
You have to determine th logic of it use
Place following code in the AfterUpdate Event of both txtbox1 and txtbox2 If len(txtbox1) > 0 then if len(txtbox2) > 0 then me.txtbox3 = me.txtbox1 + me.txtBox2 end if end if The code is executed everytime you update txtbox1 and 2. It looks to make sure the length of the information entered there is greater then 0 (makes sure you have data entered) then preforms and calculation there are lots of ways to perform the logic S- |
|
#5
|
||||
|
||||
|
I wanted to say thanks it works great. Also I wanted to make sure that I have to enter this into each box I want added correct or can I just put it under one?
Also can you tell me how to do a combo box that shows Colum A & B but when it is selected only B is shown? Thanks again |
|
#6
|
|||
|
|||
|
I would put it in each one, that when if you change one, it will be updated
S- |
|
#7
|
||||
|
||||
|
So I tried it with ing my labels in and it does not work. It gives me a error. I do not know why it is not working. Can you take a look and see if I have done something wrong.
Thanks If Len(MagnetSetInsert) > 0 Then If Len(StickyDot) > 0 Then If Len(ClearBoxMMM) > 0 Then If Len(SecurityDot) > 0 Then If Len(HeavyLaminate) > 0 Then If Len(Magnet) > 0 Then If Len(PinPlastic) > 0 Then If Len(BarPin) > 0 Then If Len(BlackPosterboard) > 0 Then If Len(GoldMagnetLabel) > 0 Then If Len(Box) > 0 Then If Len(Glass) > 0 Then If Len(Ribbon) > 0 Then If Len(ATGTape) > 0 Then If Len(Matte) > 0 Then If Len(MatteBacker) > 0 Then If Len(Tape) > 0 Then If Len(KraftPaper) > 0 Then If Len(Frame) > 0 Then If Len(PVCBoard) > 0 Then If Len(MagnetFlexRoll) > 0 Then If Len(Laminate) > 0 Then If Len(ClearSticky) > 0 Then If Len(Felt) > 0 Then If Len(MPadBacker) > 0 Then If Len(Cardboard) > 0 Then If Len(DoubleSidedTape) > 0 Then If Len(FramerPoints) > 0 Then If Len(Eflute) > 0 Then If Len(Lexan) > 0 Then If Len(AggressiveSticky) > 0 Then If Len(MetalShell) > 0 Then Me.Total = Me.MagnetSetInsert + Me.StickyDot + Me.ClearBoxMMM + Me.SecurityDot + Me.HeavyLaminate + Me.PinPlastic + Me.BarPin + Me.BlackPosterboard + Me.GoldMagnetLabel + Me.Box + Me.Glass + Me.Ribbon + Me.ATGTape + Me.Matte + Me.KraftPaper + Me.Frame + Me.PVCBoard + Me.MagnetFlexRoll + Me.Laminate + Me.ClearSticky + Me.Felt + Me.MPadBacker + Me.Cardboard + Me.DoubleSidedTape + Me.FramerPoints + Me.Eflute + Me.Lexan + Me.AggressiveSticky + Me.MetalShell End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If End If |
|
#8
|
|||
|
|||
|
What error message do you get?
By the way you are missing Magnet in a formula S- |
|
#9
|
||||
|
||||
|
I get a Compile Error: Method or data memebr not found.
And it highlights HeavyLaminate. I added the missing Magnet line. thanks |
|
#10
|
||||
|
||||
|
check the following line
Me.HeavyLaminate Is it Me.HeavyLaminate or Me.Laminate
__________________
V.Subramanian |
|
#11
|
||||
|
||||
|
Me.HeavyLaminate
|
|
#12
|
||||
|
||||
|
Check whether the control name is heavylaminate and spelled the same way in form as well as in code. If both are same it should work.
It is better to use nullto zero function than writing too many if and else. Me.Total = nz(Me.MagnetSetInsert,0) + nz(Me.StickyDot,0) + nz(Me.ClearBoxMMM,0) and so on. |
|
#13
|
||||
|
||||
|
Ill try that and see what it gets me.
Thanks |
|
#14
|
||||
|
||||
|
Okay so I tried bothand well I got rid of the Compile errors but now nothing happens. Please advise on what to do next.
Thanks |
|
#15
|
|||
|
|||
|
Can you Post this DB with the form in question
S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Help with a Sum Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|