Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 2nd, 2007, 09:49 AM
Registered User
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query must have at least one destination field

This one's a bit weird and hard to describe. On my forms (any form) when I select the criteria and click the button to perform this line:

DoCmd.OutputTo acQuery, "ManOrVolQuery", "MicrosoftExcel(*.xls)", "\\fsss253001-w\ow\users\dsilva_k\KD LEAP Database\Test\SelectAllExcel.xls", True, ""

Once in a while (I can't see a pattern to it) it errors with this:

Clicking Debug leads to this:

When I go to check the SQL statement, it's empty:

The SQL Statement:
WHERE tblCLIENTS.ManOrVol=Forms![Monthly Report]!cmbManOrVol;

The "Forms![Monthly Report]!cmbManOrVol" is a drop down box with 2 values, MAN and VOL, which gets selected during runtime.

"ManOrVolQuery" is used in the button click event of the btnManOrVol.

This problem isn't exclusive to ManOrVolQuery, it happens with all the queries. The logic and everything works fine, the sql statement just randomly dissapears -_-

Thanks in advance!

Old May 2nd, 2007, 08:05 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post

When it blows up has the user populated cmbManOrVol with either Man or Vol?

Old May 3rd, 2007, 07:47 AM
Registered User
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Yes it is populated when it blows up.

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSIS XML as a destination? GethWho BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 5 February 3rd, 2016 08:22 AM
Update Many Destination while using One Source jase2007 SQL Server DTS 0 September 20th, 2007 05:08 AM
Help-Query must have at least 1 destination field surajguru Access 4 September 13th, 2005 12:21 PM
Multiple field query PLUS Durwood Edwards Access 5 July 26th, 2005 09:08 AM
Script Component as Destination bmains SQL Server 2000 0 May 23rd, 2005 01:30 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.