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

Calculation in Query

Status
Not open for further replies.

bbcwjun

Technical User
Oct 25, 2001
12
US
I have a field in a Query that makes a calculation (ie. datediff) When I put that field in a form, i would like to be able to change the data in it that shows up but it says Field is based on an expression and cannot be edited...
Is there any way to edit this field or how to put it in a form to edit it? I tried opening the query and editing it also but says same thing??

THANKS!
 
bb,
If you want to edit just for show you could have the current calculation done in code on, say, the current event, assigning the unbound texbox value with the new calc. Obviously updating this textbox would do nothing concrete, ie you wouldn't be 'reverse-engineering' the calculation and updating any of the factors, the update would be gone when you move to next record. If there's an underlying purpose for your wanting to do this, let us know and there'll be a better way to do this.
--Jim
 
Thanks Jim! I do want to be able to edit it and save it. The field stores Latefees. So I would like to be able to change it to 0$ after someone pays it. So any suggestions? I'm new to coding (haven't done any).
 
If I may make a suggestion, You said the field stores late fees for your customers? I would suggest not deleting the value in the late fee box, but instead storing the customer's payment in a separate "payment" box. That way you'll still maintain a history on your customers in case 6 months down the road you need to know which customers have never had late fees or something like that. Maq B-)
<insert witty signature here>
 
another ideal would be to use an IIf statement as the Default Value for the Textbox, and base that on your Criteria, instead of calculating it in the query.

= IIf([ThisDate]> [DueDate], Your Calculation Goes Here, 0)


PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top