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

Unit Conversion on Reports

P: 66
Hey all,

Im using Access 2002. I've got a database set up that keeps track of all the wastes in the plant. The wastes are divided by day, and then by type of product.

Right now all my reports give the results in lbs, as per what they have been input as. I'm trying to figure out how to convert all the lbs values into cost values.

I have a table set up [Product_Values] with the fields [Product], which is the products name as appearing in the main DB, and [Value] which is a manually input value for the $/lb of product.

I have a form with a large series of buttons on it that are used to open up the varying reports, so on this form I've been trying to add a checkbox or option button, which when clicked, will cause all the reports to report in $s instead of lbs.

Can anyone give me some advice on this? I know in Excel I would use something like VLOOKUP to compare the Database product name with the name of the product in my [Product_Values] table and from there get the value associated with it. I'm just unsure how to go about this in Access.

Thanks in advance :)

Mar 1 '07 #1
Share this Question
Share on Google+
6 Replies

Expert Mod 10K+
P: 12,366
It may be easier for you to make a seperate query and report. And when they check the checkbox, it would open the other report instead.
Mar 1 '07 #2

P: 66
How do you make a check box in a form change what a button on the from does?

Say there is 1 button, if the Checkbox is not checked, the button goes to Report A, if the Checkbox is checked, the button goes to Report B?
Mar 1 '07 #3

Expert Mod 10K+
P: 12,366
In the code of the On Click for the command button, you would have something along the lines of:
Expand|Select|Wrap|Line Numbers
  1. If Me.[Checkbox Name] Then ' Checkbox is checked
  2.    DoCmd.OpenReport ...
  3. Else ' Checkbox is unchecked.
  4.    DoCmd.OpenReport ...
  5. End If
Mar 1 '07 #4

P: 66
Thank you Rabbit, it's always the programming part that gets me.
Mar 1 '07 #5

P: 66
I'm having troubl converting my data from my database.

Is there a way to add another column to a DB Table which is just a formula, so I've got my Raw data input in lbs, this column would just report that value in Dollars. I'm trying to do simple tests to get this working, by simply setting the default value of the field equal to the lbs number entered but I always get an error :(

Any ideas?
Mar 1 '07 #6

Expert Mod 10K+
P: 12,366
It is best if you don't store a calculated field in a table. It'd probably be better for you to make a select query that has the calculated field.

With that said, Access is not like Excel where you can have a field that is a formula. You have to use a query and then run that query whenever you want the calculations.
Mar 1 '07 #7

Post your reply

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