?
Solved

MS Access Sub-Form Values on Main Form

Posted on 2007-07-25
6
Medium Priority
?
284 Views
Last Modified: 2012-06-27
I'm trying to reference sub query values on my main form. I'm new to this sub-quering.

I created a form called "frmSalvageTobeSubmittedforMarkdown". I imbedded a "child" subform called "frmSalvageTobeSubmittedforMarkdown".

The sub form is a select query,  I changed a  text box to a combo box and called it "chkSubmit". The values are  'No" or "Yes". When the subform populates, all the "chkSubmit the default value of the combo box is "No".

What I'm trying to do is have an unbound control where I could calculate "cost" automatically ("like a rolling sum") when the user changes "chkSubmit" value from "No" to "Yes".  I'm I approaching this the wrong way  ? Need some guidance.
0
Comment
Question by:jumpy262000
  • 4
6 Comments
 
LVL 75
ID: 19569228
See this link for the ultimate reference in form/subform ... report/subreport systax

http://www.mvps.org/access/forms/frm0031.htm

mx
0
 
LVL 75
ID: 19569237
Sorry ... misread the Q somewhat ...

mx
0
 
LVL 75
ID: 19569246
chkSubmit is on the subform?

mx
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 75
ID: 19569257
"have an unbound control where I could calculate "cost" automatically ("like a rolling sum") when the user changes "chkSubmit" value from "No" to "Yes""

ok .. so what you happen when Yes is selected and when No is selected?

mx
0
 
LVL 44

Expert Comment

by:GRayL
ID: 19569656
Your main form and the subform have the same names.  make them different
0
 
LVL 13

Accepted Solution

by:
Ryan earned 2000 total points
ID: 19571334
In the header/footer of the subform, you can create a textbox which has the controlsource set to =sum(<field to add>)

You can leave you sum there, or link the value of that to a textbox on your main form by setting its controlsource to Forms!SubformName!TextBoxSumName

If you don't want them to show, then on the event of that yes/no control set those text box visible values.

this was just a way to avoid using code, sometimes you can keep it simple
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question