HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Microsoft Office

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-26-2007, 10:47 PM
Derek Howard
 
Posts: n/a
Default Access 07

I have a query that I export to excel with the code below. The process works
fine, however after it is finished, if I try to close access thru code or
manually, access locks up and I have to use Task List to kill the
msaccess.exe. I can continue to work in access after the export with no
problems, it is only in trying to exit do I have the problem. The query is
complex, 18 queries joined together. Sql is below.
Any ideas?

Export Code:
DoCmd.OutputTo acOutputQuery, qryName, acFormatXLS, sFile, True

Query SQL:
SELECT vRDAMAR.ARName AS [Rep Name], vRDAMAR.ARTerr AS [Territory #],
vRDAMAR.AMTerr AS [District #], vRDAMAR.RDTerr AS [Region #],
IIf(IsNull([qryExcelClientCountsOcc]![Count]),0,[qryExcelClientCountsOcc]![Count])
AS Occurred,
IIf(IsNull([qryExcelClientCountssch]![Count]),0,[qryExcelClientCountssch]![Count])
AS Scheduled,
IIf(IsNull([qryExcelClientCountscomp]![Count]),0,[qryExcelClientCountscomp]![Count])
AS Completed,
IIf(IsNull([qryExcelClientCountsclosed]![Count]),0,[qryExcelClientCountsclosed]![Count])
AS Closed,
IIf(IsNull([qryExcelClientCountspend]![Count]),0,[qryExcelClientCountspend]![Count])
AS Pending,
IIf(IsNull([qryExcelClientCountscanceled]![Count]),0,[qryExcelClientCountscanceled]![Count])
AS Canceled,
IIf(IsNull([qryExcelClientCountscclosed]![Count]),0,[qryExcelClientCountscclosed]![Count])
AS [C-Closed],
IIf(IsNull([qryExcelClientCountsccomp]![Count]),0,[qryExcelClientCountsccomp]![Count])
AS [C-Completed],
IIf(IsNull([qryExcelClientCountstotals]![Count]),0,[qryExcelClientCountstotals]![Count])
AS Total,
CCur(IIf([Total]=0,0,IIf(IsNull([qryExcelClientCountsFeePri]![FeePri]),0,[qryExcelClientCountsFeePri]![FeePri])))+IIf(IsNull([qryExcelClientCountsFeeSec]![FeeSec]),0,[qryExcelClientCountsFeeSec]![FeeSec])
AS Fee,
CCur(IIf([Total]=0,0,IIf(IsNull([qryExcelClientCountsHonorPri]![HonorPri]),0,[qryExcelClientCountsHonorPri]![HonorPri])))+IIf(IsNull([qryExcelClientCountsHonorSec]![HonorSec]),0,[qryExcelClientCountsHonorSec]![HonorSec])
AS Honorarium,
CCur(IIf([Total]=0,0,IIf(IsNull([qryExcelClientCountsOOPPri]![OOPPri]),0,[qryExcelClientCountsOOPPri]![OOPPri])))+IIf(IsNull([qryExcelClientCountsOOPSec]![OOPSec]),0,[qryExcelClientCountsOOPSec]![OOPSec])
AS [Out Of Pocket], [Fee]+[Honorarium]+[Out Of Pocket] AS [Total Money],
CCur(IIf([Total]=0,0,IIf(IsNull([qryExcelClientCountsPriYearTotal]![Total]),0,[qryExcelClientCountsPriYearTotal]![Total])))+IIf(IsNull([qryExcelClientCountsSecYearTotal]![TotalSec]),0,[qryExcelClientCountsSecYearTotal]![TotalSec])
AS [Money YTD]
FROM ((((((((((((((((vRDAMAR LEFT JOIN qryExcelClientCountsOcc ON
vRDAMAR.RUID = qryExcelClientCountsOcc.RUID) LEFT JOIN
qryExcelClientCountsSch ON vRDAMAR.RUID = qryExcelClientCountsSch.RUID) LEFT
JOIN qryExcelClientCountsComp ON vRDAMAR.RUID =
qryExcelClientCountsComp.RUID) LEFT JOIN qryExcelClientCountsClosed ON
vRDAMAR.RUID = qryExcelClientCountsClosed.RUID) LEFT JOIN
qryExcelClientCountsCanceled ON vRDAMAR.RUID =
qryExcelClientCountsCanceled.RUID) LEFT JOIN qryExcelClientCountsCClosed ON
vRDAMAR.RUID = qryExcelClientCountsCClosed.RUID) LEFT JOIN
qryExcelClientCountsCComp ON vRDAMAR.RUID = qryExcelClientCountsCComp.RUID)
LEFT JOIN qryExcelClientCountsTotals ON vRDAMAR.RUID =
qryExcelClientCountsTotals.RUID) LEFT JOIN qryExcelClientCountsFeePri ON
vRDAMAR.RUID = qryExcelClientCountsFeePri.RUID) LEFT JOIN
qryExcelClientCountsFeeSec ON vRDAMAR.RUID = qryExcelClientCountsFeeSec.RUID)
LEFT JOIN qryExcelClientCountsHonorPri ON vRDAMAR.RUID =
qryExcelClientCountsHonorPri.RUID) LEFT JOIN qryExcelClientCountsHonorSec ON
vRDAMAR.RUID = qryExcelClientCountsHonorSec.RUID) LEFT JOIN
qryExcelClientCountsOOPPri ON vRDAMAR.RUID = qryExcelClientCountsOOPPri.RUID)
LEFT JOIN qryExcelClientCountsOOPSec ON vRDAMAR.RUID =
qryExcelClientCountsOOPSec.RUID) LEFT JOIN qryExcelClientCountsPriYearTotal
ON vRDAMAR.RUID = qryExcelClientCountsPriYearTotal.RUID) LEFT JOIN
qryExcelClientCountsSecYearTotal ON vRDAMAR.RUID =
qryExcelClientCountsSecYearTotal.RUID) LEFT JOIN qryExcelClientCountsPend ON
vRDAMAR.RUID = qryExcelClientCountsPend.RUID
WHERE (((vRDAMAR.CLUID)=ClientUID()) AND ((vRDAMAR.Type)=1))
ORDER BY vRDAMAR.ARName;

Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 09-28-2007, 04:19 AM
Bob Buckland ?:-\)
 
Posts: n/a
Default Re: Access 07

Hi Derek,

You may want to use the link below to also post in the MS Office Access discussion group.

===========
<<"Derek Howard" <DerekHoward@discussions.microsoft.com> wrote in message
news:0CA494D8-C4A8-4C1F-BACF-DA5EE9A787EB@microsoft.com...
I have a query that I export to excel with the code below. The process works
fine, however after it is finished, if I try to close access thru code or
manually, access locks up and I have to use Task List to kill the
msaccess.exe. I can continue to work in access after the export with no
problems, it is only in trying to exit do I have the problem. The query is
complex, 18 queries joined together. Sql is below.
Any ideas? >>
--
Please let us know if this has helped,

Bob Buckland ?:-)
MS Office System Products MVP

>>*Courtesy is not expensive and can pay big dividends<<


LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.access
or via browser:
http://microsoft.com/communities/new....public.access

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/communit...s/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com




Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 Macros not working in Access 2000 Bob Microsoft Office 1 09-05-2007 09:40 PM
Cannot Get Internet Access - Local Access Only ColinCC Windows Vista 12 08-22-2007 01:24 PM
Access File Mistakenly typed as a Access Shortcut Q Windows Vista Installation 7 07-04-2007 02:21 PM
How to access Access Denied Folder? Abdur Rahim Sajid Windows XP 1 04-25-2007 01:17 AM
Can't access some folder; access denied kovster Windows XP 1 04-13-2007 03:46 AM


All times are GMT. The time now is 05:42 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger