By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,375 Members | 3,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,375 IT Pros & Developers. It's quick & easy.

Showing calculation output in form into table and reports

P: 3
Hoping someone can help me out here. I have a form which performs calcualtions in it. The form was build using a table with the exact same fields. I placed the one expression in the actual field where the expression is kept. The expression is as follows in a field called Primary Total

=[Exchange Mail - Win2k_Label]+[Exchange Mail - Win2k]+[Domain Controller Servers]+[Mailbox Hub Servers]+[Mail Monitoring Server]+[Blackberry Servers]+[OGD Servers]+[Mailbox Restore Servers]+[SAV Server]+[Novell OA - NT5X]+[Utility Servers - Compaq]+[Novell OA - NW5x]+[Utility Servers -IBM]

The other expression is in a filed called Primary HC. That expression is

=[Primary Total]/30+[Secondary Total]/50

Can anyone help please ?
Oct 24 '06 #1
Share this Question
Share on Google+
4 Replies

P: 143
If you can perform your calculations with a query, you don't need them in a form. As your report is based on a query, it is isn't it? use that as the record source for your report.
Oct 24 '06 #2

P: 3
thanks for your quick response Tanis. Sorry I'm fairly new to Access 2003 ..Ok so I need to put the expression into the query for the filed Primary Total let's say. So when I run the query I should be able to see all records and their primary total ? Your help is greatly appreciated. I want ot be able to run the query and show all records or be able to specify by customer name and or date range
Oct 24 '06 #3

Expert Mod 10K+
P: 14,534
Don't do these kind of calculation here. Leave the fields blank and set them in the On Load Event of the Form as follows:

Expand|Select|Wrap|Line Numbers
  2. Private Sub Form_OnLoad()
  4. Me.[Primary Total] = Me.[Exchange Mail - Win2k_Label] + Me.[Exchange Mail - Win2k] + Me.[Domain Controller Servers] + Me.[Mailbox Hub Servers] + Me.[Mail Monitoring Server] + Me.[Blackberry Servers] + Me.[OGD Servers] + Me.[Mailbox Restore Servers] + Me.[SAV Server] + Me.[Novell OA - NT5X] + Me.[Utility Servers - Compaq] + Me.[Novell OA - NW5x] + Me.[Utility Servers -IBM]
  6. Me.[Primary HC]=[Primary Total]/30+[Secondary Total]/50 
  8. End Sub
Also by doing it this way you can store the values in the corresponding fields in the table by setting the control source of the textboxes to their corresponding fields in the table.
Oct 25 '06 #4

P: 3
Tried this and it still doesn't seem to work. I added the code in the form property and placed the code as an event to on load. I get no errors however I cannot see the calculation appearing in the field on the form or in the table ?
Oct 25 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.