[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-02-15
9
Medium Priority
?
296 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:CindyDD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 800 total points
ID: 34902604
Calculated controls do not automatically save to your table.

Generally not recommended to save calculated values, but if you really need to then you will need to set the values in the Form Before update event.

mx
0
 
LVL 75
ID: 34902623
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
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34907660
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:CindyDD
ID: 34907676
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.
0
 

Author Comment

by:CindyDD
ID: 34907685
They want to be able to look at sales in a particular week of one year compared to the same week in other years.
0
 
LVL 75
ID: 34908638
Do you need additional help then with the Before Update event ?

mx
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 1200 total points
ID: 34909527
"a calculation showing the week of the year the purchase is made on"

As far as I can see, this data does not have to be stored, it can be "Derived" form the table data.
You can pull the "Week" out of the date.

If you store this data, and then the date changes, you will have to create a system to "re-store" the data.
By using a query to display the Week, none of this is required.
SELECT YourTable.TheDate, DatePart("ww",[TheDate]) AS TheWeek
FROM YourTable;

Am I missing something here?

JeffCoachman
0
 

Author Closing Comment

by:CindyDD
ID: 35319174
Not exactly what I was looking for, but it works.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35320686
ok
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question