473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

multiple criteria Dsum with subform reference

Hi there
Can anyone help me on this.
I'm trying to Dsum with 2 criterias.
It retrieves an '2450' run-time error " can't find 'sf_especificacoes'.
thx


Expand|Select|Wrap|Line Numbers
  1. t_cma_pr_calc = DSum("[t_esp_consumo]*[t_mat_pr_in]/[t_uni_factor]", "q_especificacoes", "[t_esp_t_cma_id] = " & Modelo & "AND forms!sf_especificacoes!t_mgr_uppers=-1")
Jan 9 '13 #1
2 2187
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

1) You probably need a space before the AND.
2) Domain aggregate functions don't have access to the Forms collection.
3) You don't need to. Just do the check in your code before hand.
Jan 9 '13 #2
NeoPa
32,556 Expert Mod 16PB
Rabbit:
2) Domain aggregate functions don't have access to the Forms collection.
I'm not sure that's true (I may be wrong of course). I believe the error message indicates the specified form is either misspelled or simply not open at that point.
Point #3 is always a good idea anyway ;-)

I usually advise working out the criteria beforehand in a string variable anyway, as well as to use a template form of the criteria to start with and fill in the variable parts using Replace(). That way it is much easier to see what you're doing.

In this case, the value of Forms!sf_especificacoes!t_mgr_uppers=-1 can be worked out beforehand so it's unclear why you would think you needed to include it in the DSum() call. Handling that sensibly stops all the confusion anyway it seems.
Jan 10 '13 #3

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

Similar topics

4
by: ShyGuy | last post by:
I have a table with 4 fields. Three are used for criteria. I can get the DLookup to work with 1 criteria with the following but can't get it to work with 2 or three. NumofAppts = DLookup("",...
14
by: (PeteCresswell) | last post by:
I've got a form (frmDeal) that has a subform (frmDeal_Tranche) that has a subform (frmDeal_TrancheCusip). When I try to refer to properties on the "Cusip" form at the end of the chain, MS Access...
3
by: developing | last post by:
Hello How do I specify multiple criteria for FindFirst or FindRecord (or anything else) that takes the criteria from a form. (text field and number field) edit: this will be in the after...
4
by: JHNielson | last post by:
I have a query that I'm trying to update with a dlookup with multiple criteria This is the string: EVNT_DT: DLookUp("","","( .EVNT_QTR=.) & (.=.)") When i run it it says it can't find the...
1
by: 2D Rick | last post by:
I want to open a report using OpenReport and passing it a Where Clause with multiple criteria. I know the Where Clause below is way off but it conveys what I need. Dates are of string type. ...
0
by: ChadK | last post by:
I am trying to open a report based on what the user selects on a form. Each individual criteria works but when I try to combine to pass multiple criteria it doesn't. I have read what I can find on...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
1
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
3
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.