473,699 Members | 2,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving Calculations to A Table

Ok, in my database I have something like this:

Date One
# of Days to Next Date

These calculate a field "Date Two."

Because "Date Two" is an expression (calculated by the form), I can't
set the control source to save to a field in my table. How can I save
that value to my table?

Does this make sense?

Thank you!
Debi

Dec 5 '06 #1
4 3197
I realized that I need to use VBA to make this happen.

I have "Date Two" and I'm creating a new hidden field "Date Two Print"
- this is the one that will show up on my database, right?

So.. in the properties of "Date Two Print" I went to AfterUpdate.. and
I know there is something I put there to copy whatever is in "Date Two"
and paste it into "Date Two Print" .. problem is, I don't know what! :)

Any help is greatly appreciated!!

de**********@gm ail.com wrote:
Ok, in my database I have something like this:

Date One
# of Days to Next Date

These calculate a field "Date Two."

Because "Date Two" is an expression (calculated by the form), I can't
set the control source to save to a field in my table. How can I save
that value to my table?

Does this make sense?

Thank you!
Debi
Dec 5 '06 #2
de**********@gm ail.com wrote:
Ok, in my database I have something like this:

Date One
# of Days to Next Date

These calculate a field "Date Two."

Because "Date Two" is an expression (calculated by the form), I can't
set the control source to save to a field in my table. How can I save
that value to my table?

Does this make sense?
No, it does not make sense.

Unless the caclulation is extremely demanding in terms of time and
resources, which seems unlikely in this case, it is inefficient to
store the results of calculations in a table.

Instead, when we need the calculated result we use a Select Query to do
our calculations and return our calculated field:

Yours is likely to be something like:

SELECT DateOne, DateAdd("d", NumberofDays, DateOne) AS DateTwo FROM
Table1

(Probably you should avoid calling a field "# of Days" as Access/JET
and others are particular about Field Names. It may be efficient to use
only AlphaNumeric characters and the underscore, and to begin all such
names with an Alpha character.

Dec 5 '06 #3
I need the date two stored in my table because that is the date I am
trying to pull up in a query of when this record needs to be looked at
again. For example:

Date one is when the lease commenced
# of days is how many days that lease lasts

Say date two is when the lease needs to be renewed - and an action
needs to be taken by our team. I need the table to save that date so
when I do a query of all "date two" fields that are within the next 60
days, it'll pull up each record.

I need this date 1) to show up on the database so when someone is
viewing the record they can see it and B) to save to my main table so
it can be queried.

With your solution, will this all still work?

I'm still a little new to Access so I don't know nearly as much as
others. :) Thank you for your help!!
Lyle Fairfield wrote:
de**********@gm ail.com wrote:
Ok, in my database I have something like this:

Date One
# of Days to Next Date

These calculate a field "Date Two."

Because "Date Two" is an expression (calculated by the form), I can't
set the control source to save to a field in my table. How can I save
that value to my table?

Does this make sense?

No, it does not make sense.

Unless the caclulation is extremely demanding in terms of time and
resources, which seems unlikely in this case, it is inefficient to
store the results of calculations in a table.

Instead, when we need the calculated result we use a Select Query to do
our calculations and return our calculated field:

Yours is likely to be something like:

SELECT DateOne, DateAdd("d", NumberofDays, DateOne) AS DateTwo FROM
Table1

(Probably you should avoid calling a field "# of Days" as Access/JET
and others are particular about Field Names. It may be efficient to use
only AlphaNumeric characters and the underscore, and to begin all such
names with an Alpha character.
Dec 5 '06 #4
de**********@gm ail.com wrote:
I need the date two stored in my table because that is the date I am
trying to pull up in a query of when this record needs to be looked at
again. For example:

Date one is when the lease commenced
# of days is how many days that lease lasts

Say date two is when the lease needs to be renewed - and an action
needs to be taken by our team. I need the table to save that date so
when I do a query of all "date two" fields that are within the next 60
days, it'll pull up each record.
SELECT
DetailsorWhatev er,
DateOne AS Commenced,
DateAdd("d",Day s,DateOne) AS Due
FROM Table1
WHERE
DateAdd("d",Day s,DateOne)>Date ()
AND
DateAdd("d",Day s,DateOne)<Date Add("d",61,Date ());
ORDER BY
DateAdd("d",Day s,DateOne)

Dec 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2957
by: SJH | last post by:
I have been given an older database and asked to make upgrades and what not. One interesting thing I have come across with the database is that it was at one time set up so one of the tables would hold values that were calcuated using a form. I have looked at the code for all the text boxes on the assocatied forms and have yet to figure out how this was done. There were two values set up this way, one still works and the other one...
3
2575
by: brian kaufmann | last post by:
Hi, I had sent this earlier, and would appreciate any suggestions on this. I need to make calculations for unemployment rate for three different data sources (A,B,C) for many countries and age groupings. The calculation is: unemployment rate = number of unemployed/number of labour force
2
2607
by: Scot Niklos via AccessMonster.com | last post by:
Sorry if it is way to much information but I'm trying to cover all bases Access 97 A= combobox that queries Distributor B= combobox that limits customers by distributor in a C= combobox that shows equipment inventory at b OriginalVAL= query that extracts original $ amount from INV table based on matching EquipmentID seleced in C (currency)(listbox)(unbound). BTA = query that calculates total amount for all $ transactions for...
18
3794
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having trouble. I have tried keeping some of the fields bound and when I use the save button it has been saving as 2 different records. This is unacceptable. This is what I have, can anyone help me out with this?
2
3060
by: maflatoun | last post by:
Hi guys, I have to make a event signup page for our company that would display the event time/date in 3 different time zones (Eastern - New York, Central - Chicago, and Pacific - San Francisco). To do this. I convert the inputed date from local time zone and convert it into UTC and store it in the database (correct me if I'm wrong please). Next to display it I would add the correct time zone difference value (-5 for Eastern). How to do...
3
4001
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table with a createElement function to add additional entries. The table has the first row of input text boxes already in it. You have to click a button to add another row. That seems to be working fine. How do I pull the information from the input boxes...
9
1711
by: matthew.newsome | last post by:
I have two fields on a query, one is a count and one is either Red, Amber or Green So my results are Red 5 Amber 7 Green 2 I need to calculate the count of Reds (5) by a factor of 10 giving me
1
1565
by: Grubsy4u | last post by:
Grubsy4u Newbie 7 Posts October 5th, 2007 11:31 AM #1 Report calculations --------------------------------------------------------------------------------
9
2621
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of the main floors of the main house: Part C: Gross Floor Area of the basement or cellar: Part D: Gross Floor Area of the attic:
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.