The Dread Of Storing A Calculated Value

Nov 5, 2004

Hi all, another beginner question here.

I have a table of records which is is basically temp storage, once I'm done inputing information, an append SQL statement is run to move the data to its permament table, then I use a delete statement to remove the values in the temp table.

Now, I have a column called Result, which stores the values of a radio button group (1, 2, or 3). I have a series of queries which count the number of times 1 or 2 appear (3 in this case, doesn't matter since it represents N/A. 1 = True, 2 = False, 0 = Null).

I'm having trouble getting the result of said query to store in a table. The statement is as follows:

SELECT [qryGetFail]![CountFail]+[qryGetPass]![CountPass] AS Total

FROM qryGetFail, qryGetPass;

This returns the sum of both counts, so I know how many questions were answered either Pass or Fail, hence I know how to score record. Here is my Append SQL statement as it currently works:

INSERT INTO tblAuditResults ( Question, Result, Comment, ACAPS, AuditDate, TeamMember, Auditor )
SELECT tblQuestions.Question, tblQuestions.Result, tblQuestions.Comment, [Forms]![frmAuditCreate]![txtACAPS] AS Expr1, [Forms]![frmAuditCreate]![txtAuditDate] AS Expr2, [Forms]![frmAuditCreate]![cmbTeamMember] AS Expr3, [Forms]![frmAuditCreate]![txtAuditor] AS Expr4

FROM tblQuestions

WHERE (((tblQuestions.Product)="4" Or (tblQuestions.Product)=[Forms]![frmAuditSelect]![txtVarProduct]) AND ((tblQuestions.Function)="3" Or (tblQuestions.Function)=[Forms]![frmAuditSelect]![txtVarFunction]));

This stores everything I need it to. But I cannot for the life of me get the statement to accept a value from a qeury and store it. I have tried adding another expression but it always just prompts for the value instead of pulling the value from the qryGetCalc.

Is there a specific way to have an INSERT statement pull a value off an active query?

View Replies


ADVERTISEMENT

Storing Calculated Fields

Aug 9, 2005

New to Access and learning the hard way. Im sure this is an easy one, but sure would appreciate the help. I am trying to sum a group of cells and display the total, which i have done. But I also want to store this total in my database. So my question is, how do i move my calculated total to my field that has the "record source" bound back to my field in the database? Hope that makes sense. Thanks in advance.

View 3 Replies View Related

Storing A Calculated Control.??

Jan 3, 2006

if i have formula in a text box can that calculation be stored in a table???

example

sales total

sales tax

grand total

where grand total = sales tax+sales total

if the control is bounded to a field in a table once the formula is entered doesnt it loose the connection with the field???

right now when i enter a formula in a control it will no longer store it in the table but it will only show the result in the actual form..???

View 4 Replies View Related

Storing Calculated Fields In A Table

Apr 20, 2007

I know that it is bad form to store a calculated field in a table - normalization and all that - but I can see no other way around a need that I have.

I'm trying to make a database to store injury time for employees. If an employee is injured, he can do light work for a certain amount of time, but this light work need not be contiguous. But, the total time on light work must be known so as to see when it is used up.

For example:

Bob is injured on 4/1/06 and goes on light work on 4/2/06 until 4/5/06 (4 days). Bob is then taken off light work until 4/10/06 when he reinjures the same injury. This does not count as a new injury, because it is an aggravation of the old one. So, Bob goes back on light work on 4/10/06 until 4/15/06 (6 days).

So, I need to store Bob's total time on light work for this injury (10 days) so that I can keep a running total to check against the maximum for a single injury. All I can think of is to store the sum of days on light work as a field in Bob's injury record, but that means storing a calculated field in a table.

Am I missing an easy way to do this, or is there a method to do what I want that I am just not aware of?

Thanx for any help!

View 2 Replies View Related

Storing A Calculated Field On A Table

Aug 10, 2007

Hi,

I know it breaks all the rules to store a calculated field on a table, but I've painted myself into a corner with the way I built this particular database, not good, I have repeating groups and basically the whole database is built this way. I need one form to store a calculated value on a table to solve a problem on a report that encapsulates the total of all the repeating groups. Before you start the lecture, I know I messed up, but this is way to far down the road to start over. Any help would be greatly appreciated.

Gary

View 13 Replies View Related

Sum Queries And Storing Calculated Fields

Aug 26, 2005

Hello All,

Probably trying to do the impossible.

Normally I would never (that’s a long time) have the results of a calculated field in a table, but I’m stumped.

Table1
TestID: Autonumber
Quantity: Number
Selected: Yes/No

Table2
SumID: Autonumber
TestID: Number, Foreign Key
Quantity Delivered: Number

Query1-Sum Query
Table2
TestID: Group
Quantity Delivered: Sum

Query2- Select Query
Record Sets

Query1 Table1
TestID-----------------------------------TestID
Quantity Deliverd Quantity
Select

Fields in Query2
TestID from Table1
Select from Table 1

Run Query
Can’t update “Select” field


So I’m thinking that I should create a 3rd query to update the summed Quantity Delivered into a new field in table 1. Which would in effect create a stored calculated field.

View 2 Replies View Related

Tables :: Storing Calculated Values?

Mar 7, 2014

I understand the conventional wisdom of not storing calculated values on the table, but I have a need to do do so. On my Input Screen I have a generated Certificate # derived from 5 single value fields keyed onto the screen. This certificate # is unique to those 5 single-value fields which should not be repeated. I want to store it on my Table as the Primary key with "no duplicates" so that if a keyer keys the same 5 single-digit values , thus creating the same Certificate #, he will get a MsgBox back telling him he cannot add a duplicate entry.

attached is my table and Input Screen.

View 3 Replies View Related

General :: Storing Calculated Fields

Sep 16, 2013

I have a score marking template for an internal audit. A criteria is either met, or it is not. All of these questions have Yes/No data type. each question has a weighting. I have written a VBA function to work out the total score by using a bunch of If statements.I need to store the final result in a table, by entering the answers (yes or no) into a form.

View 4 Replies View Related

Storing Calculated Fields - Example Post For SBaxter

Aug 15, 2004

Here is an example of what I was talking about re: private message and storing calculated fields. Any help is much appreciated.

Also I received your email in regards to a sample secure database but I am getting a "Memory could not be read" error when I try to open it. Does this have anything to do with how it has been converted to 97 format or is it an error at my end? (I've been able to open other dbases from the forum).

Thanks,

Dearnne

PS Thanks also for your help with adding to option groups.

View 4 Replies View Related

Tables :: Storing Calculated Values In Table

Jan 8, 2014

I know that as a general rule one should not store calculated values in a table, but if I need to include such a value on a number of forms, and calculating that value involves manipulating an ADO Recordset, does there come a point where the performance hit outweighs the design "quality"?

View 1 Replies View Related

Forms :: Storing Calculated Control Of A Subform

Jul 5, 2015

Eventhough i know calculated control are for queries, I still need to store a calculated value of a sum. I have a form with customers, dates, locations. That form has a subform that contains the services done and materials used. This subform is in datasheet view. In the footer i have a control with =Sum([Price]).

So I need the value of this control to be stored in the table the main form is based on. I did an unbound control in the main form where the =Me!Subform.Form!.Textx will bring the value "over" Then for the on focus event the vba code Me.Total=Me.Textx stores the value. That is fine. The same works with a command button with the same vba code.

However i am asking if there is a more automatic way to get the value over without the unbound control/command button.

View 7 Replies View Related

General :: Storing Calculated Fields In A Table

Jul 26, 2012

I know that it isn't usually best practise to store calculated fields in a table, but in my situation it is necessary, and I haven't really found a good answer for this after searching these and other forums.

Currently my database has one "Name" field (I didn't make it like this) which might look like this "Jonathan (John) Smith"
Now I also have reason to grab the name like this "Smith, John" for other purposes.

I've set up a form for inputting new people with separate fields for firstname, preferredname, and lastname. I have the calculated fields:

=[fname] & " (" & [pname] & ") " & [lname]
=[lname] & ", " & [pname]

(Later I will add in all the iif's for if there is no preferred name)

Upon finishing the form, the user hits Submit, and I would like to store the concatenated values into the table in their appropriate fields.

I can do this with a SQL INSERT INTO statement but I'd have to add all 25 or so fields from the form, and injecting user input directly into a SQL statement is not best practice either.

View 2 Replies View Related

Forms :: Accounting Program - Storing Calculated Value

Aug 5, 2013

I am trying to create an accounting program on access and i got stuck on the final touches

I'll explain my situation in brief. I created two tables

/1 for the invoices (invoice number, client name, total)
/1 for the orders (order id, invoice number, subtotal)

And I made a relationship between those two and everything worked out well. I created a form/subform and put a text box in the subform to calculate the sum which worked correctly. And I exported the value of the sum to the main form and it's great.

The problem is that how can i make the Total field that belongs to the table invoice have a default value as same as the Expression (sum) so that the sum is stored with the invoice record.

i attached the picture in the attachments

View 10 Replies View Related

Problem Storing A Value Calculated By Unbound Text Boxes

Mar 6, 2006

I have 3 values in unbound text boxes and a 4th text box that is calculating the sum of the first three text boxes, i need the result of the calculation to be stored in the field "Total Cost" that is also on this form.

Any ideas

Cheers Mikk

View 5 Replies View Related

Storing A "Calculated" Field.

Oct 7, 2005

Hey there,

I want to store a "calculated" value from a form text-box. By calculated, i simply mean that it is a textbox that contains the following Data:
=[MemberFirstName] & [MemberLastName]
Basically, the field is the Members Username, the text box is called "Username" and it needs to be stored in "tblMemberInfo" under "MemberLogin" so that it can be used externally for the website.
The value is only going to be calculated automatically by the form once, and then it wont need to be changed again, which is why i want to store it in the db.

Any ideas on how i'd go about doing this?

Cheers
Fatmcgav

View 2 Replies View Related

Storing Files

May 8, 2005

I am doing my comptuer science coursework and one thing I need to include is "how does access stored files" and the basic description of file organisation. After some googlging around though I have found nothing, can anyone hlep me out on this?

Thanks
Chris

View 3 Replies View Related

Storing A Parameter?

Jul 27, 2005

Hello,
I am designing a query as i have been advised in the following Quote:
Doc ManNow, you write a couple of queries. As a parameter to the queries, choose a date that will be your archiving cutoff or split point. Usually the last day of some month or quarter. Doesn't matter as long as you are consistent about it. The technical cutoff will be, in effect, 23:59:59 of the chosen date. The first record to be KEPT will be 00:00:00 of the next day in sequence.

Query #1 - Compute stock on hand as of your cutoff date. Create a single stock-on-hand transaction with the cutoff date. Put it in a temporary table until you need it. This will be a two-layer query. I.e. a query of a query.

Query #1A - a summation query grouped by item number for all transactions earlier than the archiving date so you can get the "inventory of X at archiving date"

Query #1B - an append query that draws from the summation query and feeds it to the temp table. The stock-on-hand record will have the archiving date

.
I am able to get "inventory of X at archiving date" and append the results to a temporary table but I can't see how to append the "archiving Date" data itself to the same table as the "Archiving date" is entered via parameter prompt? Any ideas?

View 2 Replies View Related

Storing Passwords

Nov 4, 2005

Hi guys how do you store secure passwords in the database?

So that if someone has acess to the database they want be able to see what they are.

View 5 Replies View Related

Storing Values?

Mar 10, 2006

Howdy

I know that you shouldn't store totals in Access, but I can't think of a way around what I want to achieve and wondered if anyone had any ideas.

An item on stock will move from one location to another, I will need to list the 'balances' of this stock at each location, easy enough to do, but there are hundreds of item movements per day and the users do not want a history of movements to be kept but do require an ongoing balance.

e.g.
100 of the item moves from A to B, this movement record gets deleted, how would I know that the item stock at A has been reduced by 100 and B raised by 100?

View 1 Replies View Related

Storing Updates?

Mar 31, 2005

Hi all

I have a database that stores customer records and their associated insurance details. I need to be able to track any changes made to that record within a set time period ie if details are changed fine it is reported next time report is run. But if details are changed more than once in between reports then first detail change is lost.

I would like to work out a way that changes can be written to a ??seperate version of the table?? and stored in there to be reported seperately and not just the final change as is the snapshot nature of a report? Is this possible? Could I possible make another version of the main table appended onto it? I feel I 'know' what I need to do but not how to even begin it! Any help would be appreciated.

DDiver

View 1 Replies View Related

Storing Addresses

Apr 11, 2005

I am currently designing a contacts database for my business and need some advice on how to store addresses.

As I see it, I can either use a single field and carriage returns, or multiple fields which for some records may leave some blank fields.

The data will be used to perform mailmerges and will also be output to a contacts directory and I would be looking to display the address both horizontally and vertically. Is there a simple way of manipulating a multi line field so that it can be displayed on a form across the page on one line in a report?

View 2 Replies View Related

Best Method Of Storing This Data?

Jun 7, 2005

Hi everyone,

I've recently begun building a database to keep track of stock at work. Nothing particularly special or difficult. I have a little bit of prior experience with Access and VB, but not heaps.

Basically, I've created a tables for parts, companies etc, and am relating all the data together.

At the moment I've made a form that allows you to enter a new part, with Part Number, Description, Category, Supplier, etc.

The complication comes when I want to create an ASSEMBLY of parts. I'd like to create an assembly (which has a lot of similarities to a part, in that it has a part number, description etc), and that assembly needs to store a list of parts that it includes. A simple assembly might include a few items, ie, a bowl of meatballs includes the bowl, a fork, the spaghetti, and 5 meatballs. A more complex assembly (a complete dinner for 5) might include 5 bowls of meatballs (a sub assembly), pepper and salt, 5 glasses and two bottles of coke.

I'm not sure how to best store this assembly data...

I can't really have a table with a finite number of "part" spots because the assemblies get quite large. I'd rather not use an ugly VB macro that stores the PartID's with quantities either, as that could get thoroughly out of hand pretty quickly.

I'm sure there must be a simple method for doing this, but without having a clue as to what it might be called I can't really look for it in help!

Any clues you guys could give me would be great.

Thanks

Col.

View 1 Replies View Related

Advice On Storing Archives

Jun 24, 2005

I've created a simple database in which we enter order id (automatic), date (automatic), customer, po#, shipping date, and ship via.

then we scan the order (which may be from 2-20 pages long) into the computer so that we do not need to keep actual paper (trying to save on office space).

these files then get inserted the scanned object subform (containing the fields scan number, object, and order id).

I'm realizing that because we'll be scanning quite a few orders that this may take up quite a bit of space, i'm wondering if linking the objects rather than saving them within the database will help.

the only problem with this is that if we move the files containing the actual scanned images, that the whole system will get screwed up.

Does anyone have any ideas?

Thanks in advance

View 14 Replies View Related

Storing Images In Databases

Jan 12, 2006

i am about to create a simple database for an estate agency..

they would like to have one image per record of the property (from the outside)

and 3 or 4 images per record of the property (interior shots)

how can you store images/multiple images in access for a particular record..im sure it has something to do with the ole object

View 4 Replies View Related

Table For Storing Updates

Nov 21, 2004

How do I create a table relationship where a secondary reltated table stores past dates, status code and customer ID. For example: I want to keep track of the past dates that an order was revised and why it was revised. So, if I have a customer who was due for installation on 10/21/04 and status is PEND for pending. THen on 10/18/94 I change the date of PEND to 10/25/04. I want to keep track of the times it changed and the reason why. HOw can I make the program automatically create a record in the revision table storing the past code, reason and date using customer ID as key and teh revision table would allow multiple records for each customer ID. DId I make sense?

View 2 Replies View Related

Storing Questionnaire Configurations

May 22, 2007

I'm building a questionnaire/survey database for my work. Everything seems pretty straightforward, but I'm a little unsure about how to store the survey configurations.

I'm assuming that the survey will change sometime between now and the end of time so I'm tracking survey configurations (which questions and in what order). Right now my "Configuration" table has two fields: ConfigID (Autonumber), Questions (Memo). The 'Questions' field is a space seperated list of question IDs. The other way I could've done it is to use three fields: ConfigID (Long), OrderNum (Int), QuestionID (Long).

I figure the first way is more memory efficient in the long run and it will take much less time to add a new configuration.

The way I'm doing things now works for me, but I'd like to know if anyone thinks I'm setting myself up for trouble down the road or if my way is actually less memory efficient (I'm not as concerned with processing time).

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved