Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Using a Query to Calculate Combo Box Info
Andrea Buckridge 
     
11 days ago
I am rebuilding part of my database. Right now, I am inputting mileages in many different places in my database, and I realized that I should have had Mileages as a separate table. In looking at how to change this, I realized that my calculated fields aren't going to work the same using mileages through combo boxes instead of just entering them. How do I write an expression in a query to subtract the Mileage last fill from the current mileage, both stored as Mileage ID in two fields on the same form?
Andrea Buckridge OP  @Reply  
     
11 days ago
Nevermind, I figured it out. Now my only question is. Do I base my form on the query now? I didn't think entering data should be done on a form based on a query. Or am I wrong there. I need to the total calculated by my query as i enter the information in the form.
Richard Rost  @Reply  
          
11 days ago
If you want to display the calculated total (like the difference between current and last fill mileages) on your form as you're entering data, basing your form on that query is actually a really good and common approach in Access. Forms can be based on tables or queries, and using a query is often better when you need calculations, extra fields, or need to pull in related data from other tables.

The only time you really run into trouble is if your query is too complex (for example, involving multiple tables joined in certain ways) or if Access makes the form non-updateable. As long as your query is updateable - which usually means it draws fields from a single table or from related tables in a way Access understands - you can add, edit, and delete records through the form just fine.

So, you're definitely not wrong to build a data entry form on top of a query, especially since you need to see that total calculated as you're entering each mileage record. If you find that your form suddenly won't let you type into fields, that probably means the query is non-updateable, and then you'd have to look at rewriting it or splitting calculations into unbound controls. But if it's letting you edit your data, you're good to go.
Andrea Buckridge OP  @Reply  
     
11 days ago
Thank you so much. Moving this database from using separate mileages all over the place to using one table for it is going to take time, but I've hit on the steps to slowly integrate the MileageT one step at a time. today I was able to completely convert the FuelStopT, FuelStopF, and all connected queries as well as the Assigned miles information. It's an active database, so it'll take a while before I have all the redundancies deleted and I'm solely relying on the MileageT
Add a Reply Upload an Image
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: 5/7/2026 1:13:40 AM. PLT: 0s