I am using a Dsum() within the textbox to calculate a value. After I change the numbers in the fields used for the calculation, the textbox does not automatically refresh with the current calculations. What function will do this? Thanks.
Are you thinking in terms of the Events that will be firing because if you have code in the textbox properly and are changing data within the correct domain, the text box will update, even if the data is changed by an external application.
So my only conclusion is that the fields you are updating are not being saved when you think they are or you have an incorrect DSum expression for what you intend.
Examples would be helpful if you told us what the DSUM expression is, and what your form is based on.
After the user changes either of two numeric fields(and hits enter), then the seperate textbox(which holds the computations) will update by using ControlSource=Dsum(..)+Dsum(..) -This is what I was hoping for. It only updates the field after a scroll through the records. The computation textbox is in the footer, so it shows up for all record totals. I hope this will help more. Maybe I need to move the Dsum somewhere else?
Still need the code you are using. I knew you were using DSUM becuase you said so. It's the bits inside the DSum where you typed "..." I was interested in.
From your description, the user types values and presses enter. At what point do they SAVE the record? Did you realise that DSum has nothing at all to do with the controls on your form (unless you use one of them to provide a criteria). All DSum is meant to do is sum a field form a table or query which an optional filter. It doesn't care about your form at all
I just got it working! I found some code that was autogenerated via making a button that refreshes the form. The code was "DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70" I don't have a clue what it does, but it works! Somehow the textbox code is called again.
I appriciate you trying to help me. Thanks.
You did not realise that typing something on a form and pressing enter by default does not save the record. It is saved when you navigate away, or close the form and a few other ways.
The code you used, selects the 5th item in the Records menu of an Access 2000 or above menu bar. In this case, "Save Record" which you can use Shift-Enter to achieve as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.