Link to home
Create AccountLog in
Avatar of CindyDD
CindyDDFlag for United States of America

asked on

Access 2007 Two controls will not save to the record source.

I have set the DataEntry property to YES.
I have set the recordsource for the form to the correct table. All controls show the same table.
Two controls-both of which are calculated fields, will not save to the table. I have gotten them to save once but something changed and now they will not save.
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
You can do that like this (EXAMPLE)

Private Sub Form_BeforeUpdate (Cancel As Integer)
    Me![Field1] = Me.txtCalcValue1
    Me![Field2] = Me.txtCalcValue2
    Me![Field3] = Me.txtCalcValue3
      ' and so on
End Sub
But please note what MX mentioned above:

    "Generally not recommended to save calculated values,"

So even though this is possible, it is not recommended in most cases.

So can you take a step back and first explain the nature of these calculations, and explain why you feel that they should be "Stored"?

JeffCoachman
Avatar of CindyDD

ASKER

Only one of them is important to save. It is a calculation showing the week of the year the purchase is made on. This is for forcasting sales etc.
Avatar of CindyDD

ASKER

They want to be able to look at sales in a particular week of one year compared to the same week in other years.
Do you need additional help then with the Before Update event ?

mx
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of CindyDD

ASKER

Not exactly what I was looking for, but it works.