Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 4th, 2004, 12:33 PM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #2  
Old March 4th, 2004, 01:39 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
me.txtbox3 = me.txtbox1 + me.txtBox2

I sure you want more then that, but without more info...
S-

Reply With Quote
  #3  
Old March 4th, 2004, 02:16 PM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Were do I place that code?

Reply With Quote
  #4  
Old March 4th, 2004, 02:32 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
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-

Reply With Quote
  #5  
Old March 4th, 2004, 04:30 PM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #6  
Old March 4th, 2004, 04:39 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
I would put it in each one, that when if you change one, it will be updated

S-

Reply With Quote
  #7  
Old March 4th, 2004, 06:01 PM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #8  
Old March 4th, 2004, 11:15 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
What error message do you get?

By the way you are missing Magnet in a formula

S-

Reply With Quote
  #9  
Old March 5th, 2004, 09:03 AM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I get a Compile Error: Method or data memebr not found.

And it highlights HeavyLaminate.

I added the missing Magnet line. thanks

Reply With Quote
  #10  
Old March 5th, 2004, 09:15 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
check the following line
Me.HeavyLaminate

Is it Me.HeavyLaminate or Me.Laminate
__________________
V.Subramanian

Reply With Quote
  #11  
Old March 5th, 2004, 09:43 AM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Me.HeavyLaminate

Reply With Quote
  #12  
Old March 5th, 2004, 09:54 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
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.

Reply With Quote
  #13  
Old March 5th, 2004, 10:05 AM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Ill try that and see what it gets me.

Thanks

Reply With Quote
  #14  
Old March 9th, 2004, 05:29 PM
jediwizzo's Avatar
jediwizzo jediwizzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 35 jediwizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #15  
Old March 9th, 2004, 05:51 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Can you Post this DB with the form in question

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Help with a Sum Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump