Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Supress dialog box when MS query returns more than 65536 rec's

When the query from Microsft query builder executes and returns data which
exceeds the sheet limit (65536 rows), a dialog box prompting (ok/cancel) gets
displayed. Is it possible to supress this dialog box, either through settings
or through VBA code? either ways plz suggest the way to do it.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Supress dialog box when MS query returns more than 65536 rec's

If you don't care about the records you might lose, the best way to do this
is to limit your query so it can only return 65535 rows (leaving room for a
header row in this case); you can do that by adding a TOP n clause to the SQL
statement.

Make sure you have your query working well first, since editing the SQL
statement can make it impossible to visually represent the query in the
MSQuery grid. Then press the SQL button and change SELECT to read SELECT TOP
65535, as in the example:

SELECT TOP 65535 PHONEBOOK.NAME, PHONEBOOK.ADDRESS, PHONEBOOK.PHONE_NO FROM
PHONEBOOK WHERE PHONEBOOK.CITY = 'PHILADELPHIA'

If you can't lose those excess records, forget MSQuery and use ADO instead
to retrieve the full recordset inside VBA - then you can move the excess
records onto a new sheet or whatever you need to do.
--
- K Dales


"Asha" wrote:

When the query from Microsft query builder executes and returns data which
exceeds the sheet limit (65536 rows), a dialog box prompting (ok/cancel) gets
displayed. Is it possible to supress this dialog box, either through settings
or through VBA code? either ways plz suggest the way to do it.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Supress dialog box when MS query returns more than 65536 rec's

Quick and dirty solution that might work:-

Application.DisplayAlerts = False



"K Dales" wrote:

If you don't care about the records you might lose, the best way to do this
is to limit your query so it can only return 65535 rows (leaving room for a
header row in this case); you can do that by adding a TOP n clause to the SQL
statement.

Make sure you have your query working well first, since editing the SQL
statement can make it impossible to visually represent the query in the
MSQuery grid. Then press the SQL button and change SELECT to read SELECT TOP
65535, as in the example:

SELECT TOP 65535 PHONEBOOK.NAME, PHONEBOOK.ADDRESS, PHONEBOOK.PHONE_NO FROM
PHONEBOOK WHERE PHONEBOOK.CITY = 'PHILADELPHIA'

If you can't lose those excess records, forget MSQuery and use ADO instead
to retrieve the full recordset inside VBA - then you can move the excess
records onto a new sheet or whatever you need to do.
--
- K Dales


"Asha" wrote:

When the query from Microsft query builder executes and returns data which
exceeds the sheet limit (65536 rows), a dialog box prompting (ok/cancel) gets
displayed. Is it possible to supress this dialog box, either through settings
or through VBA code? either ways plz suggest the way to do it.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Supress dialog box for missing linked file FlaProcessEng Excel Programming 1 September 23rd 05 07:49 PM
Supress Query Refresh dialog on opening workbook Paul Tugwell Excel Programming 1 August 8th 05 11:27 PM
Supress SaveAs dialog box? Ed Excel Programming 4 March 11th 05 02:20 AM
Dialog Box Query John[_78_] Excel Programming 2 November 2nd 04 01:39 PM
Dialog Query gORDON Excel Programming 2 January 11th 04 04:56 PM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"