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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Calculator issue
David McAfee 
    
3 years ago
So I'm using Rich's calculator in a subform and it works but when I open the main form, I get an error message: Run-time error '2465': Microsoft Access can't find the field 'Quantity'referred to in your expression.

The following is the code in the calculator VBA:

If Not IsNull(Calc) And Not IsNull(TempVars("CalculatorFieldReturn")) And _
        Not IsNull(TempVars("CalculatorFormReturn")) Then
            'set value in form that called calculator
                        Forms(TempVars("CalculatorFormReturn")).Controls("Quantity") = Calc

Help!!! :-)
John Davy  @Reply  
         
3 years ago
'set value in form that called calculator should give you a clue. Which form calls it in Richard's application?
David McAfee OP  @Reply  
    
3 years ago
I'm not sure I understand what you are saying. As I said, the form works when I'm testing it in the subform by itself but when I use the main form/subform together, I get the error message.
John Davy  @Reply  
         
3 years ago
Hi David,
Please watch Richard's Calculator 7 Extended Cut. I think that will help.
John
David McAfee OP  @Reply  
    
3 years ago
I've watched it so many times I've got it memorized. :-) Thanks
John Davy  @Reply  
         
3 years ago
Since it can't find Quantity then you should test   Forms(TempVars("CalculatorFormReturn")).Controls("Quantity") = Calc  to see what the statement really is telling you. Since it works from the subform and not the main form I suspect that is where your problem is. Try trouble shooting it and let me know. John
David McAfee OP  @Reply  
    
3 years ago

David McAfee OP  @Reply  
    
3 years ago
John, thanks for your reply that I just now have seen. I tried what you said and still received a Run-time error '2465' message. See image attached.
David McAfee OP  @Reply  
    
3 years ago
Works perfectly when I run the subform alone.
Scott Axton  @Reply  
        
3 years ago
In design mode click on the Quantity control.  Viewing the properties did you give it a name?
Also check spelling.


Scott Axton  @Reply  
        
3 years ago
Double check naming for a Subform.  Value From a Form
David McAfee OP  @Reply  
    
3 years ago
You got it! Thank you for referring me to the Value From a Form link! It had the "path" I needed (for lack of a better term). This was it:
Forms!BridgesF!CompsTsubform.Form!Quantity = Calc

Thank you!
Scott Axton  @Reply  
        
3 years ago
Glad it helped!

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: 5/7/2026 1:05:51 AM. PLT: 1s