I am running a calculation based on a value that is entered into a control on
a form (the calculation runs when a button is clicked) however it does not
return the correct value until I have moved onto the next record and then
back again - I assume forcing an update to the record.
Is there any way (preferably through using a Macro since I am really
struggling with the VB) to get this to happen
Thanks
Allen Browne - 09 Jul 2005 16:52 GMT
The calculated value will be updated when the record is saved.
You can force the record to be saved with the RunCommand action.
In the lower pane of the macro design window, choose the SaveRecord
argument.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I am running a calculation based on a value that is entered into a control
>on
[quoted text clipped - 6 lines]
>
> Thanks
HelenJ - 09 Jul 2005 17:13 GMT
Thanks Allen - just what I was looking for
> The calculated value will be updated when the record is saved.
>
[quoted text clipped - 12 lines]
> >
> > Thanks
Mike Painter - 09 Jul 2005 17:01 GMT
> I am running a calculation based on a value that is entered into a
> control on a form (the calculation runs when a button is clicked)
[quoted text clipped - 4 lines]
> Is there any way (preferably through using a Macro since I am really
> struggling with the VB) to get this to happen
The result of a calculation should be displayed and not kept.
= [Quantity] * [price] in an unbound test box is one way.
TotalPrice:[Quantity] * [price] in a query is a better way.
While there are times when this approach is not suitable you should not
attempt to store a calculateed value until you know why you should *not* do
it.
HelenJ - 09 Jul 2005 17:14 GMT
Thanks Mike and yes I do understand that - this is not quite the situation
that you have described
> > I am running a calculation based on a value that is entered into a
> > control on a form (the calculation runs when a button is clicked)
[quoted text clipped - 13 lines]
> attempt to store a calculateed value until you know why you should *not* do
> it.