473,473 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Update a table from a form with a subform

9 New Member
I have attempted using both Updata and Append Queries to solve this problem, and I can't seem to get it to work.

I have three forms that each have an ID#, and a subform with related scores to questions. In the subform I have a textbox that sums the scores, and a field that stores the date the scores were obtained.

What I want to do is to store the ID#, the date and the score summation from each of the three forms into a table. This should be done automatically if possible, like once the form is closed a query will run and update the table from the form.

I have tried to use criteria in the query to update the table with the appropriate data from the form using the [Forms]![Form Name]![Data Point] format, but this only works on the main form or only on the subform with a dialog box coming up for the other form depending on which data point in place furthest to the left in the Query Design View.

I think I have a solid idea of what I need to do, but I am getting caught up in the nuances of running the query and the criteria.

Any help would be appreciated.

Thank you
Jul 25 '07 #1
1 3210
JConsulting
603 Recognized Expert Contributor
I have attempted using both Updata and Append Queries to solve this problem, and I can't seem to get it to work.

I have three forms that each have an ID#, and a subform with related scores to questions. In the subform I have a textbox that sums the scores, and a field that stores the date the scores were obtained.

What I want to do is to store the ID#, the date and the score summation from each of the three forms into a table. This should be done automatically if possible, like once the form is closed a query will run and update the table from the form.

I have tried to use criteria in the query to update the table with the appropriate data from the form using the [Forms]![Form Name]![Data Point] format, but this only works on the main form or only on the subform with a dialog box coming up for the other form depending on which data point in place furthest to the left in the Query Design View.

I think I have a solid idea of what I need to do, but I am getting caught up in the nuances of running the query and the criteria.

Any help would be appreciated.

Thank you

A code solution using the form's on_close event may give you what you want.

example:

Expand|Select|Wrap|Line Numbers
  1. currentdb.execute "Insert Into yourtable ("datefield","otherfield","otherfield") values ("& me.myformfield1 & "," & me.myformfield2 & "." & me.myformfield3 &")
  2.  
  3.  
J
Jul 31 '07 #2

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

Similar topics

1
by: Kunal | last post by:
Hi, I need some help on writing an update query to update "UnitsSold" field in Products Table whenever I save a transaction. The transaction may contain several "Subtransactions", one for each...
1
by: Joe.Mobley | last post by:
All, When you sell a product we require access to remove that information from the stock table, so the product is sold througha comobo box named "Combo4" under the prodcuts sold form which is a...
9
by: DP | last post by:
hi., i've got 3 tables, customer, film and filmrental. i've got a customer form, with a sub form at the bottom, which is a film rental subform. i've created an update query, which when a...
2
by: Ron | last post by:
Hi All, Okay, I've got a frmOrders with a subform of sfrmDetails. A frmClient has all the client info, plus a subform of sfrmDefaults that has the client's normal ordering defaults (like set...
1
by: jeffro | last post by:
I have a database used for recording survey data. In the database, I have a form that displays a survey participant and a subform that is filled in by selecting a question from a looklist and...
0
by: Access Programming only with macros, no code | last post by:
ERROR MESSAGE: Could not update; currently locked by another session on this machine. BACKGROUND I have the following objects: Table1 - HO (which has about 51,000+ records) Table2 -...
6
by: KevinPreston | last post by:
Hello everyone, this is my first post so apologies if i dont get it right first time, i am a self taught Access user, i am stuck on something i am trying to do, briefly i have 2 tables, one for...
16
by: mlcampeau | last post by:
I'm fairly new to this so I'll try to be as clear as possible. I have a database that stores employee information and all job titles available. I have a main form that is based from a query and...
1
by: bbatson | last post by:
Hello, I have two tables that are feeding a form/subform relationship. The first table, called "Tbl_Projects" lists a variety of projects taken on by a department. A second table called...
0
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,...
0
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...
0
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,...
1
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...
0
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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.