Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Question to use Queries or not
Jerry Fowler 
       
3 years ago
A Non-Profit animal shelter that I volunteer at has asked me to look at their older Access Database to bring it up to date.  So I have made a backup and I'm beginning to look at it feature by feature.

Since I will be touching every aspect of this DB I thought this would be a good time to see if I could weed out some queries.  What are your thoughts and or suggestions about whether to use a separate Query or the SQL and put it in the RecordSource of the Forms or Reports?
Just browsing I'm seeing some 300+ Queries and quite a few of them look very similar with just 1 or 2 differences.
Kevin Yip  @Reply  
     
3 years ago
What does "bring it up to date" mean?  You need to ask them for the specifics.  They may think it means one thing and you take it and another.  Do they want to upgrade Access version?  Reduce file size? Add functionalities?  Or "trim the fat", whatever that means (again ask for specifics)?  Needless to say, you need to do what they specifically require, first and foremost.  I'm sensing that you feel like you should delete some of the queries.  In this early stage, the last thing you should plan to do is delete anything.  Get their exact requirements first.
Jerry Fowler OP  @Reply  
       
3 years ago
Sorry, Kevin they did give me a lot more specifics, and bringing it up to date basically means there is more data they wish to track and there is data they no longer need, which I told them I would suggest not to delete any data they have. there are form changes they would like to make.
I will be working off of a Backup and before I delete anything I will test it thoroughly. I was looking for suggestions on using a Query or the SQL statement as the RecordSource for Forms, and Reports. Mainly if it's a query for just one form and not being used anywhere else.  They do have Office 2021 and the Access DB has been working fine but not meeting all their current needs.
And eventually will want to make this available to 4-6 users to enter data.  Right now 1 person at a time does their work, then the next person does theirs and so on.
Kevin Yip  @Reply  
     
3 years ago
It used to be that saved queries run faster than SQLs because saved queries are compiled and optimized.  But on today's superfast PCs, my experience has been that it hardly makes a difference, in most cases anyway.  But there are some tactical advantages of using saved queries as record sources over SQLs.  Such as...

If the record source of a form (or report) is a saved query, and in the form's properties or VBA code, you add a filter, then you have access to the data in both the original unfiltered recordset and the filtered one:

Original unfiltered recordset:    CurrentDb.QueryDefs("MySavedQuery").OpenRecordset
Current filtered recordset:     Form("MyForm").Form.Recordset

But if you use an "on-the-fly" SQL statement as the record source, you can only get a recordset of the current, possibly filtered version.  This may sound a little too nerdy, but you never know if you ever need that recordset in your coding.  

A more common advantage of saved queries is in the case of online data retrieval from, say, a Winhost SQL Server database, in which case you likely need to use a lot of saved queries called "passthrough queries", which are queries that Access doesn't run, but "passes" to the online server to improve performance.  But if you put a bare SQL as in the record source, it can only run as a Jet-engine query.  To put a passthrough query in the record source, you have to used a saved query.
Kevin Yip  @Reply  
     
3 years ago

Kevin Yip  @Reply  
     
3 years ago
Regarding deleting anything in your database, it is only worthwhile to do it if storage space costs you $$$, as in the case of online storage.  The cheapest Winhost plan only allows 500 megabytes of SQL Server database, and in that case you really have to keep your table sizes in check.  If you have Access DBs locally stored on huge hard drives, you usually don't worry about file size unless and until hard drive space shortage becomes a problem.
Richard Rost  @Reply  
          
3 years ago
When it comes to removing queries and putting the SQL in your forms directly that's something that I definitely recommend once you get to that point in your learning of how to build databases. But you have to be very careful going back and deleting older queries because you never know which objects might need them. Always make good backups. But generally if it ain't broke don't fix it. If you don't really need to get rid of those old queries then there's no reason to have to delete them. They don't really take up much space in your database.
Jerry Fowler OP  @Reply  
       
3 years ago
Thanks for the great info, I always great useful info when I come here. My membership has paid for itself many times over. I'm not planning on removing any of the items from the project till it's been fully tested and in production for a while. (But) that will be a long time from now.  Right now I'm planning more to implement the SQL inside the form to new things that are added and like you say "if it ain't broken don't fix it".

Again thanks

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/7/2026 10:45:06 PM. PLT: 0s