By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,376 Members | 3,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,376 IT Pros & Developers. It's quick & easy.

Update a table from a form with a subform

P: 9
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
Share this Question
Share on Google+
1 Reply


JConsulting
Expert 100+
P: 603
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

Post your reply

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