473,769 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

saving query info in a table via a form

2 New Member
I have a new case tracking system. The cases table has these fields:

CaseID (Primary Key)
StatusID (looked up in another table - Open, Pending, or Closed)
Status Comment (memo field)
Date&Time (when casse was opened)
ProjectID (looked up in another table - various projects are listed there)
CustomerID (looked up in another table - list of names and other info for each)
Request (memo field)
Result (memo field)
TotalTime (decimal)

I then have another table that keeps track of the steps taken to resolve the cases:

StepTakenID (Primary Key)
CaseID (linked to Cases table)
StepDate&Time (when step was initiated moving forward with the case)
Step (memo field)

I then have another table that keeps track of the resources needed for each step:

ResourceUsedID (Primary Key)
StepTakenID (linked to StepsTaken table)
ResourceID (looked up in another table - list of names and other info for each)
TimeSpent (decimal)
Comments (memo)

=============== =====

Okay, I can run a query that sums up the TimeSpent for all the resources used for all the steps taken for each case

SELECT tblCases.CaseID AS tblCases_CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID AS tblStepsTaken_S tepTakenID, tblStepsTaken.C aseID AS tblStepsTaken_C aseID, tblResourcesUse d.StepTakenID AS tblResourcesUse d_StepTakenID, Sum(tblResource sUsed.TimeSpent ) AS SumOfTimeSpent
FROM (tblCases INNER JOIN tblStepsTaken ON tblCases.CaseID = tblStepsTaken.C aseID) INNER JOIN tblResourcesUse d ON tblStepsTaken.S tepTakenID = tblResourcesUse d.StepTakenID
GROUP BY tblCases.CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID, tblStepsTaken.C aseID, tblResourcesUse d.StepTakenID;

Notice it Sums the TimeSpent fields for each case and give a SumOfTimeSpent. ..and that works.

=============== =====

Okay, I have a form that displays information for each case (I can flip through the cases). I cannot seem to populate the TotalTimeSpent field on my form. I would also like to store this value in the TotalTime field in my Cases table (I know this is abnormal, but I still want to do that).

Thanks for any help!!!
chris.orear at ed.gov
Aug 24 '06 #1
3 1933
MMcCarthy
14,534 Recognized Expert Moderator MVP
It's probable that your query is not editable. If you want to check then run the query outside of the form. If you cannot add a new record then the query is not editable. You will have to approach this differently if you need to edit the data.



I have a new case tracking system. The cases table has these fields:

CaseID (Primary Key)
StatusID (looked up in another table - Open, Pending, or Closed)
Status Comment (memo field)
Date&Time (when casse was opened)
ProjectID (looked up in another table - various projects are listed there)
CustomerID (looked up in another table - list of names and other info for each)
Request (memo field)
Result (memo field)
TotalTime (decimal)

I then have another table that keeps track of the steps taken to resolve the cases:

StepTakenID (Primary Key)
CaseID (linked to Cases table)
StepDate&Time (when step was initiated moving forward with the case)
Step (memo field)

I then have another table that keeps track of the resources needed for each step:

ResourceUsedID (Primary Key)
StepTakenID (linked to StepsTaken table)
ResourceID (looked up in another table - list of names and other info for each)
TimeSpent (decimal)
Comments (memo)

=============== =====

Okay, I can run a query that sums up the TimeSpent for all the resources used for all the steps taken for each case

SELECT tblCases.CaseID AS tblCases_CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID AS tblStepsTaken_S tepTakenID, tblStepsTaken.C aseID AS tblStepsTaken_C aseID, tblResourcesUse d.StepTakenID AS tblResourcesUse d_StepTakenID, Sum(tblResource sUsed.TimeSpent ) AS SumOfTimeSpent
FROM (tblCases INNER JOIN tblStepsTaken ON tblCases.CaseID = tblStepsTaken.C aseID) INNER JOIN tblResourcesUse d ON tblStepsTaken.S tepTakenID = tblResourcesUse d.StepTakenID
GROUP BY tblCases.CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID, tblStepsTaken.C aseID, tblResourcesUse d.StepTakenID;

Notice it Sums the TimeSpent fields for each case and give a SumOfTimeSpent. ..and that works.

=============== =====

Okay, I have a form that displays information for each case (I can flip through the cases). I cannot seem to populate the TotalTimeSpent field on my form. I would also like to store this value in the TotalTime field in my Cases table (I know this is abnormal, but I still want to do that).

Thanks for any help!!!
chris.orear at ed.gov
Aug 24 '06 #2
corear
2 New Member
I ended up adding a button to my form to do the calculations when clicked.

1. create another query to SUM all the total times

2. create a form to use data from the new query and fill in the CASEID based on the alreay-open form

3. create a macro to open the form, use the SetValue to sync up the main form with the tomtal time on the new form, and close the new form

==========

So, I have a query that sums up the resource times for each step

I then have another query that comes and sums those for each case.

I used the form wizard to tell it to use data from an existing form to fill in the CaseID.
Sep 19 '06 #3
PEB
1,418 Recognized Expert Top Contributor
Hi,

Your TotalTimeSpent maybe is a sum of some fields isn't it?

You can Show it using formula in it's control source

=[Field1]+[Field2]+[Field3]

And to save this value in the database

On Form Current Event choose Event procedure
and type:

Me[TotalTimeSpent]=me![Field1]+me![Field2]+Me![Field3]

:)

I have a new case tracking system. The cases table has these fields:



CaseID (Primary Key)
StatusID (looked up in another table - Open, Pending, or Closed)
Status Comment (memo field)
Date&Time (when casse was opened)
ProjectID (looked up in another table - various projects are listed there)
CustomerID (looked up in another table - list of names and other info for each)
Request (memo field)
Result (memo field)
TotalTime (decimal)

I then have another table that keeps track of the steps taken to resolve the cases:

StepTakenID (Primary Key)
CaseID (linked to Cases table)
StepDate&Time (when step was initiated moving forward with the case)
Step (memo field)

I then have another table that keeps track of the resources needed for each step:

ResourceUsedID (Primary Key)
StepTakenID (linked to StepsTaken table)
ResourceID (looked up in another table - list of names and other info for each)
TimeSpent (decimal)
Comments (memo)

=============== =====

Okay, I can run a query that sums up the TimeSpent for all the resources used for all the steps taken for each case

SELECT tblCases.CaseID AS tblCases_CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID AS tblStepsTaken_S tepTakenID, tblStepsTaken.C aseID AS tblStepsTaken_C aseID, tblResourcesUse d.StepTakenID AS tblResourcesUse d_StepTakenID, Sum(tblResource sUsed.TimeSpent ) AS SumOfTimeSpent
FROM (tblCases INNER JOIN tblStepsTaken ON tblCases.CaseID = tblStepsTaken.C aseID) INNER JOIN tblResourcesUse d ON tblStepsTaken.S tepTakenID = tblResourcesUse d.StepTakenID
GROUP BY tblCases.CaseID , tblCases.TotalT ime, tblStepsTaken.S tepTakenID, tblStepsTaken.C aseID, tblResourcesUse d.StepTakenID;

Notice it Sums the TimeSpent fields for each case and give a SumOfTimeSpent. ..and that works.

=============== =====

Okay, I have a form that displays information for each case (I can flip through the cases). I cannot seem to populate the TotalTimeSpent field on my form. I would also like to store this value in the TotalTime field in my Cases table (I know this is abnormal, but I still want to do that).

Thanks for any help!!!
chris.orear at ed.gov
Sep 20 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2965
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...
6
1758
by: S. Graefner | last post by:
Hello Folks, I'm a Relitive newbie to the blood sport of MS ACCESS. I have designed and built a database with multiple, Related, tables. The db works well, more by good luck then good planing I expect. The problem I'm faced with is being able to save certian fields from the various tables to a floppy and then Download/Import them to an exact copy of the database on another computer located elsewhere. This has to be done with a floppy or...
2
4082
by: Tolu | last post by:
Hello I am trying to save information from one form to two tables. I have a table for Student info and Transcript line. I have a form that list all the classes (using text boxes) a student is supposed to take to graduate. This form also has a combo box for assigning grades for each class. I am trying to save information from the form to the student info table and to save each class on the form as separate records in the transcript line...
3
4573
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and set textboxes, radio buttons, etc - that viewstate is fine. Then I have a linkbutton that does a Server.Transfer over to Page2.aspx. When I Server.Transfer back to Page1.aspx, the viewstate info is lost. I ran across another example of this last...
2
1999
by: Cary | last post by:
This may reveal my poor programming skills, but here goes... I'm building a pricing tool for my business. I'm nearing the end of the project, and I've been asked to be able to save quotes in some sort of database (Major Feature Creep). For each quote, I've got two kinds of variables. The first are global for the quote, such as numQuoteRows QuoteFinalCost CustomerID
3
1877
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key fields to keep out duplicates. I am trying to put a full name box on the query, that uses the FirstName, LastName and Middle Initial and puts them together to form a full name. That I have so far. On my order database(consisting of a master table with...
0
8673
southoz
by: southoz | last post by:
Good ay all , I'm fairly new to access(a little over 5 weeks now). Since I'v started I have picked up a lot of useful information from forums such as this and in doing so will share that information with others. I have seen many request for information on mail merging an how to send data to word documents this is something I have put together with the answers given by others and I hope this will help a few newbies , I know there are easier ways...
3
1776
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was a "table" stored with the C# front-end (not in the Access database), but don't know if this is even possible. If it is, can someone let me know how? Otherwise, how do other people handle storing and loading query strings for possible later use?
0
1582
by: ll | last post by:
I'm currently working with an ASP page that populates rows based on a query for course data by using a DO WHILE NOT EOF loop. An improvement I'm adding is a dropdown populated by query which shows each course number, so that the user can populate that course page with data from a previous course. My question is: once the data from the previous course is populating the current course page (after being selected from the aforementioned...
0
9589
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
9423
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
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
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
8876
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...
0
6675
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();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.