|
|
DSum help
Being new to vba and Access, I think what I am trying to do is out of
my realm of understanding. I have two querries that query the same
table "QtyUsed". One query "QtyUsed6Mo" filters results by the date
field to records within the last 6 months. The other "QtyUsedYr"
filters within the last year. I want to create a DSum that will add
all the records in the query that have the same "NSN" and add the qty
"Used" to another table "DataTable.QtyUsed6Mo and DataTable.QtyUsedYr"
|
|
0
|
|
|
|
Reply
|
Bobby
|
1/28/2008 10:03:05 PM |
|
Bobby,
Usually it is not good practice to store these calculations in a table.
You can always use the query, both queries 6Mo and Yr to give the calculated
values for a form's recordsource or for a report.
Using the query instead of a table, gives you the most up-to-date value for
the values. It also avoids the problem that can happen when one of the dates
is edited and this changes the value for QtyUsed. If the calculation was in
a table, you would need to change the value in the table every time one of
the dates was edited - that is too much work - much easier to just use the
query.
Note: there are some databases that do need to store a calculated value in a
table, but this is not very frequent.
Jeanette Cunningham
<Bobby.Dannels@gmail.com> wrote in message
news:a15eeec7-6ed7-4073-98aa-31452d247557@b2g2000hsg.googlegroups.com...
> Being new to vba and Access, I think what I am trying to do is out of
> my realm of understanding. I have two querries that query the same
> table "QtyUsed". One query "QtyUsed6Mo" filters results by the date
> field to records within the last 6 months. The other "QtyUsedYr"
> filters within the last year. I want to create a DSum that will add
> all the records in the query that have the same "NSN" and add the qty
> "Used" to another table "DataTable.QtyUsed6Mo and DataTable.QtyUsedYr"
|
|
0
|
|
|
|
Reply
|
Jeanette
|
1/28/2008 10:13:22 PM
|
|
Can I not write a code that will update the table every time the value
in the query changes? If not, how would I write the code that I need
to have the form pull straight from the query?
|
|
0
|
|
|
|
Reply
|
Bobby
|
1/28/2008 10:47:11 PM
|
|
On Jan 28, 2:47=A0pm, Bobby.Dann...@gmail.com wrote:
> Can I not write a code that will update the table every time the value
> in the query changes? If not, how would I write the code that I need
> to have the form pull straight from the query?
More importantly how would I get the query to filter the table by the
nsn that is currently being displayed in the form?
|
|
0
|
|
|
|
Reply
|
Bobby
|
1/28/2008 11:38:35 PM
|
|
Yes you could write code to do this. What happens if someone imports data
into the table? It is not best practice to store the calculation.
To have the form pull straight form the query - you would do a DLookup to
the query and put the result in a label or textbox.
Jeanette Cunningham
<Bobby.Dannels@gmail.com> wrote in message
news:a9969329-76ae-40a5-916a-7d12ff404389@v46g2000hsv.googlegroups.com...
> Can I not write a code that will update the table every time the value
> in the query changes? If not, how would I write the code that I need
> to have the form pull straight from the query?
|
|
0
|
|
|
|
Reply
|
Jeanette
|
1/29/2008 4:33:03 AM
|
|
In design view of the query, in the criteria row for nsn, type the correct
syntax for the name of the nsn control on the form.
Forms!YourFormName!TheControlName - assuming a form that is not a subform.
As long as the form is open, the query will be able to get the nsn value
from the form.
Jeanette Cunningham
<Bobby.Dannels@gmail.com> wrote in message
news:befe8479-892e-4472-b6ef-613e971ba070@l1g2000hsa.googlegroups.com...
On Jan 28, 2:47 pm, Bobby.Dann...@gmail.com wrote:
> Can I not write a code that will update the table every time the value
> in the query changes? If not, how would I write the code that I need
> to have the form pull straight from the query?
More importantly how would I get the query to filter the table by the
nsn that is currently being displayed in the form?
|
|
0
|
|
|
|
Reply
|
Jeanette
|
1/29/2008 4:39:25 AM
|
|
|
5 Replies
219 Views
(page loaded in 0.117 seconds)
Similiar Articles: DSum between dates - microsoft.public.access.formscoding ...Access Help and How-to - Microsoft Office dsum & between dates ... i want to use dsum to sum data between two dates that are fields on the form. i can't seem to get the ... Parameter Query with DSum - microsoft.public.access.queries ...Any help with correct dsum format would > >be appreciated. > > > >Without the parameter the dsum returns the correct value. Below is the sql > > > >PARAMETERS ... Dsum in report header problem - microsoft.public.access.reports ...I have a text box in a report header where I need to use dsum because the I need the ... Thanks for your help. > Yes, CosPerPaycheck and FundStatus are fields in the table ... dsum with 2 criteria - microsoft.public.accessYearCabinsTurnover = DSum("[SumOfSubTotal]", "Query8", "[Year]=" & NowYear & " And [OrderType]= 2") Please look up, in VBA help Restrict + "Restrict data to a ... DSum in Queries - microsoft.public.accessIt is wonderful having people like you out there in cyber world to help us out. "Ken Snell (MVP)" wrote: > SELECT New_Cost, > New_Cost/DSum("New_Cost ... Adding "If Statement" with DSum - microsoft.public ...... with a database that needs a small adjustment to the following code: =DSum ... Did none of the four answers you've gotten the past couple of days help? multiply one text box on report by a value - microsoft.public ...... fields that produce a sum of values in a query this is achieved by =-DSum("[xxxxxx ... gen0018.htm >> >> >> Tom Wickerath >> Microsoft Access MVP >> https://mvp.support ... DSUM Date Criteria - microsoft.public.access.queriesDSUM with date criteria from form - Microsoft Access Forums Hello people. Need help with a dsum code and date criteria. The following code is used to display the "sum" of ... Running Sum - microsoft.public.access.queriesBacklog of B - Cleared + Received. and so on? Im guessing its a DSUM thing, but i cant make the connection. Appreciate any help. Regards, CommonParameters help - microsoft.public.windows.powershell ...Any help with correct dsum format would >be appreciated. > >Without the ... aggregrate functions (DSum, DMax, DMin, DLookup, etc.) share the same common parameters ... DSUM - Excel - Office.comShow All Hide All Adds the numbers in a column of a list or database that match conditions that you specify. Syntax DSUM ( database , field , criteria ) Database is ... DSum Function - Access - Office.comYou can use the DSum function to calculate the sum of a set of values in a specified set of records (a domain ). Use the DSum function in a Visual Basic for ... DSum Help: help - Experts Exchange - Your Technology Questions ...Here is a message: The object doesn't contain the Automation object 'DatRevd.' You tried to run a Visual Basic procedure toset a property or method for an ... DSUM HELP!!! - WUGNET ForumsComplete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more! How to Use Excel's DSUM Function | eHow.comExcel's DSUM function is short for "database sum." It adds the values in a column of a database that match the specified criteria. DSUM then calculates its return ... 7/16/2012 1:10:19 AM
|
|
|
|
|
|
|
|
|