Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 9th, 2003, 03:36 AM
Authorized User
 
Join Date: Jun 2003
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default Query to return 37 records

Hi all,

Good day. I need my query to return 37 records, even if the exact record is less than 37. For example, the query will search for my criteria and return few records. Say it is 5 records that matches my parameters. However, I need the query to give me 37 records. Which means 5 actual records and rest 32 is blank records.

How can I achieve that?

Thanks,
Maha
Reply With Quote
  #2 (permalink)  
Old October 9th, 2003, 07:00 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You're going to have to write the output of the query to a table. If the table is not 37 records long, you'll have to run an append query to append X blank records to your table until you get 37 records.

To prevent the original query from giving you more than 37 records to start with, set the query property "Top Values" equal to 37.

OK, now I'm curious. Why would anyone want a query to give 37 records even though the true output may be less?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old September 10th, 2004, 02:00 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

What is the basic need for that.

If you are having for the grid/window to display at a time.
Create tmp. table of displaying query fields only.
add first 37 or less from resultant query.
check for the no. of records in the tmp table if less add upto 37/no. of recors required.




Reply With Quote
  #4 (permalink)  
Old September 10th, 2004, 02:37 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear it is very simple that you creat a loop which runs 37 time and in this loop you display your record one by one by adding a recordset and using if statement that if recordset.eof then it should not move to next record and simply continue the loop
I think you got my point if no then contact me without any hesitation. I would like to help you.



Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return Primary Key of Last Append Query mselkregg Access 1 November 16th, 2006 11:36 AM
Return from different records in same table rodmcleay SQL Language 2 October 10th, 2005 08:51 PM
Cannot display/return SQL Query Output from a Vari sjm SQL Server DTS 1 September 9th, 2005 11:40 AM
Query That Return 0 Rows in Results nimrod_r BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 June 5th, 2005 02:14 AM
looping through return records in sproc jtyson SQL Server ASP 5 July 14th, 2003 10:16 AM



All times are GMT -4. The time now is 07:02 AM.


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