PC Review


Reply
Thread Tools Rate Thread

Complex Query not working on report

 
 
Broken Coder
Guest
Posts: n/a
 
      16th Apr 2010
I recently started using 07 on a fe/be db created in 03. The query below
worked fine in 03 but now gives me the "enter parameter value" box asking for
"tblRECORDS.CREATE" when I open a report based on it with 07. The query
still opens and displays fine, but the report seems to hangup. Is it a
timing issue? I know the query is kind of busy, but it is based on a table
where the data is stored as 1s or 0's to make big queries calculate faster.

SELECT tblRECORDS.QAC, tblRECORDS.CHS, Sum(IIf([IO]="INBOUND",[BR],0)) AS
IBR, Sum(IIf([IO]="OUTBOUND",[BR],0)) AS OBR, Sum(IIf([IO]="INBOUND",[SH],0))
AS ISH, Sum(IIf([IO]="outbound",[SH],0)) AS OSH,
Sum(IIf([IO]="inbound",[MD],0)) AS IMD, Sum(IIf([IO]="outbound",[MD],0)) AS
OMD, Sum(IIf([IO]="INBOUND",[LG],0)) AS ILG, Sum(IIf([IO]="outbound",[LG],0))
AS OLG, Sum(IIf([IO]="inbound",1,0)) AS IT, Sum(IIf([IO]="outbound",1,0)) AS
OT
FROM tblRECORDS
WHERE ((tblRECORDS.CREATE Between [Forms]![frmRptMnu]![txtStart] And
[Forms]![frmRptMnu]![txtEnd]))
GROUP BY tblRECORDS.QAC, tblRECORDS.CHS;

 
Reply With Quote
 
 
 
 
Broken Coder
Guest
Posts: n/a
 
      16th Apr 2010
Thanks...I'll look for that. Any idea why it all displayed correctly in 03?

"Marshall Barton" wrote:

> Broken Coder wrote:
>
> >I recently started using 07 on a fe/be db created in 03. The query below
> >worked fine in 03 but now gives me the "enter parameter value" box asking for
> >"tblRECORDS.CREATE" when I open a report based on it with 07. The query
> >still opens and displays fine, but the report seems to hangup. Is it a
> >timing issue? I know the query is kind of busy, but it is based on a table
> >where the data is stored as 1s or 0's to make big queries calculate faster.
> >
> >SELECT tblRECORDS.QAC, tblRECORDS.CHS, Sum(IIf([IO]="INBOUND",[BR],0)) AS
> >IBR, Sum(IIf([IO]="OUTBOUND",[BR],0)) AS OBR, Sum(IIf([IO]="INBOUND",[SH],0))
> >AS ISH, Sum(IIf([IO]="outbound",[SH],0)) AS OSH,
> >Sum(IIf([IO]="inbound",[MD],0)) AS IMD, Sum(IIf([IO]="outbound",[MD],0)) AS
> >OMD, Sum(IIf([IO]="INBOUND",[LG],0)) AS ILG, Sum(IIf([IO]="outbound",[LG],0))
> >AS OLG, Sum(IIf([IO]="inbound",1,0)) AS IT, Sum(IIf([IO]="outbound",1,0)) AS
> >OT
> >FROM tblRECORDS
> >WHERE ((tblRECORDS.CREATE Between [Forms]![frmRptMnu]![txtStart] And
> >[Forms]![frmRptMnu]![txtEnd]))
> >GROUP BY tblRECORDS.QAC, tblRECORDS.CHS;

>
>
> That means something in your report (a text box expression
> or in Sorting and Grouping) is referencing tblRECORDS.CREATE
>
> If you can find it, you need to decide if you should remove
> it from the report or modify the query's select list to
> include the CREATE field.
>
> --
> Marsh
> MVP [MS Access]
> .
>

 
Reply With Quote
 
Sylvain Lafontaine
Guest
Posts: n/a
 
      16th Apr 2010
When switching between different versions of either Access or of Windows -
including the installation of Service Packs - you should always make a full
decompilation of the MDB or ACCDB file first; as this will often solve many
"strange" problems. I have no idea if this will solve your problem but it
takes only a few seconds to do it: go to the References dialog window in
the VBA editor, add a dummy reference (anyone) and close the References
window (important!). As the list of references has changed, this will force
Access to recompile all the module the next time they are needed. You can
also launch the Recompile All Modules from the Debug menu. Immediately
after having changed the list of references, you can reopen the References
window and delete the dummy reference that you have just added as Access has
already noted the change when you close the window after the first step.

Another method is to create a windows shortcut to your database with the
following options:

/decompile /compact /repair

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)


"Broken Coder" <(E-Mail Removed)> wrote in message
news:8A18A3BF-9A7E-477B-B401-(E-Mail Removed)...
> Thanks...I'll look for that. Any idea why it all displayed correctly in
> 03?
>
> "Marshall Barton" wrote:
>
>> Broken Coder wrote:
>>
>> >I recently started using 07 on a fe/be db created in 03. The query
>> >below
>> >worked fine in 03 but now gives me the "enter parameter value" box
>> >asking for
>> >"tblRECORDS.CREATE" when I open a report based on it with 07. The query
>> >still opens and displays fine, but the report seems to hangup. Is it a
>> >timing issue? I know the query is kind of busy, but it is based on a
>> >table
>> >where the data is stored as 1s or 0's to make big queries calculate
>> >faster.
>> >
>> >SELECT tblRECORDS.QAC, tblRECORDS.CHS, Sum(IIf([IO]="INBOUND",[BR],0))
>> >AS
>> >IBR, Sum(IIf([IO]="OUTBOUND",[BR],0)) AS OBR,
>> >Sum(IIf([IO]="INBOUND",[SH],0))
>> >AS ISH, Sum(IIf([IO]="outbound",[SH],0)) AS OSH,
>> >Sum(IIf([IO]="inbound",[MD],0)) AS IMD, Sum(IIf([IO]="outbound",[MD],0))
>> >AS
>> >OMD, Sum(IIf([IO]="INBOUND",[LG],0)) AS ILG,
>> >Sum(IIf([IO]="outbound",[LG],0))
>> >AS OLG, Sum(IIf([IO]="inbound",1,0)) AS IT,
>> >Sum(IIf([IO]="outbound",1,0)) AS
>> >OT
>> >FROM tblRECORDS
>> >WHERE ((tblRECORDS.CREATE Between [Forms]![frmRptMnu]![txtStart] And
>> >[Forms]![frmRptMnu]![txtEnd]))
>> >GROUP BY tblRECORDS.QAC, tblRECORDS.CHS;

>>
>>
>> That means something in your report (a text box expression
>> or in Sorting and Grouping) is referencing tblRECORDS.CREATE
>>
>> If you can find it, you need to decide if you should remove
>> it from the report or modify the query's select list to
>> include the CREATE field.
>>
>> --
>> Marsh
>> MVP [MS Access]
>> .
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report Won't Run - Query Is Too Complex Slej Microsoft Access Reports 7 21st Oct 2008 04:38 AM
complex query/report Ruth Microsoft Access 5 20th Feb 2008 11:31 PM
Report Query Too Complex =?Utf-8?B?VC4gVXRsZXk=?= Microsoft Access Queries 0 23rd May 2005 11:15 PM
Complex report/query =?Utf-8?B?Sk1vcnJlbGw=?= Microsoft Access Reports 0 13th Oct 2004 05:00 PM
query for complex report Andy Microsoft Access Queries 1 12th Aug 2003 03:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:17 PM.