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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use calculated field on form to populate field in table

Status
Not open for further replies.

Mikeyis4dcats

Technical User
Jan 16, 2003
59
0
0
US
I have a field on a form that is calculating service fees based on whether a box is checked or not. I would like this field to populate a corresponding field in the table the form is based on.

How can this be done?
 
As a general rule, one should not store calculated fields in tables ( however, this may be an exception, in which case, bind the control to a field and use code to update it. Choose a suitable event, one that affects the calculated control, and add a little code:

[tt]Me.txtCalc=Me.txtFee * Me.txtHours[/tt]
 
my ultimate goal is to print a report as a receipt, showing that the selected services cost $X and the total was $Y. If I shouldn't save the values in a table, how could I structure a query to obtain that information off the form to display on the report?
 
You would normally have a table that matched a customer with a service:

[tt]CustomerService table:
CustomerID
ServiceID[/tt]

You can then create a query that sums services for each customer, getting the costs, and service name if relevant, from the Services table. Check out the link I provided for more information.
 
Why would you need a query? An unbound field on a report is the same as an unbound fields on a form. Do the same thing. You are storing the checkbox?
 
here's a screenshot of the form. What I'm trying to do is allow the user to check boxes to charge for services, and be able to see the total cost in case the customer asks.


The fees are based on an IIF function to check if the box is checked. My initial thought was to then pull back the determined value into a table that a report can query for a receipt. But I'm very open to ideas.

I am an Access novice, and I am just trying to help my wife complete a class assignment for a class she never should have taken and will never have to use Access again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top