T
Tony Williams
I know it's sad posting on Xmas day but I'm on a cruise ship in the middle of
the Indian Ocean and there's not much else to do!!!
I have a report based on a qry "qrySalesV2", in the header is a Date/time
control "txtqtr2" based on a date/ time field txtmonthlabel and I'm
calculating the same date 1 year previous in a control txtqtr2 using this
code
=DateAdd("m",-12,[txtqtr1])
In the detail section is a txt control "Sum of txtDomfactot" and I'm
attempting to find the the same value of this control for "txtqtr2" using
=DLookup("[Sum of txtDomfactot]","qrySalesV2","[txtmonthlabel]=[txtqtr2]")
I've also tried "[txtmonthlabel]=#" & [txtqtr2] & "#"
If I run my report with either then the report runs OK and all the records
for all the table are found.
However if I try to run the report by entering a prompt in the query for the
field "txtmonthlabel" and asking the user to input a specific date to find
the data for one date only, I get the "txtDomfactot" and "txtqtr2" values but
not the Dlookup values, I get #Error instead. All the date fields and
controls are formatted mmmm yyyy
Why should asking for a prompt in the query criteria stop the report from
giving me the calculated controls? Running only the query with the prompt
also works.
Anyone who can spare the time to help over Xmas would be appreciated!
Thanks and Merry Xmas
Tony Williams
the Indian Ocean and there's not much else to do!!!
I have a report based on a qry "qrySalesV2", in the header is a Date/time
control "txtqtr2" based on a date/ time field txtmonthlabel and I'm
calculating the same date 1 year previous in a control txtqtr2 using this
code
=DateAdd("m",-12,[txtqtr1])
In the detail section is a txt control "Sum of txtDomfactot" and I'm
attempting to find the the same value of this control for "txtqtr2" using
=DLookup("[Sum of txtDomfactot]","qrySalesV2","[txtmonthlabel]=[txtqtr2]")
I've also tried "[txtmonthlabel]=#" & [txtqtr2] & "#"
If I run my report with either then the report runs OK and all the records
for all the table are found.
However if I try to run the report by entering a prompt in the query for the
field "txtmonthlabel" and asking the user to input a specific date to find
the data for one date only, I get the "txtDomfactot" and "txtqtr2" values but
not the Dlookup values, I get #Error instead. All the date fields and
controls are formatted mmmm yyyy
Why should asking for a prompt in the query criteria stop the report from
giving me the calculated controls? Running only the query with the prompt
also works.
Anyone who can spare the time to help over Xmas would be appreciated!
Thanks and Merry Xmas
Tony Williams