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 Expert 9    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Discount Trouble
Richard Van Wagoner 
      
2 years ago
This is probably another stupid thing for me. But I have watched the Expert 9 video Numerous times and I can't get the discount rate to cascade down to the order detail form. I can get it to cascade to the order form from the customer Form but not from the order form to the order detail form. I have tried to get the information from the customer form to put it on the order detail Form and it still does not work. Which leads me to believe that it is something in the order detail form. I will include the screenshots of the forms and the discount rate properties.
Richard Van Wagoner OP  @Reply  
      
2 years ago

Richard Van Wagoner OP  @Reply  
      
2 years ago

Sami Shamma  @Reply  
             
2 years ago
Richard,

please share screen shot of Customer, Order and Order Details tables in Design view
Richard Van Wagoner OP  @Reply  
      
2 years ago

Richard Van Wagoner OP  @Reply  
      
2 years ago

Richard Van Wagoner OP  @Reply  
      
2 years ago

Sami Shamma  @Reply  
             
2 years ago
what happens when you add a new order detail line?
Richard Van Wagoner OP  @Reply  
      
2 years ago
The discount stays at 0%
Kevin Yip  @Reply  
     
2 years ago
Create ANOTHER new record and see what it shows.

A default value is set BEFORE a new record is created.  If the default value changes, you have to make another new record in order to get the new default value.
Richard Van Wagoner OP  @Reply  
      
2 years ago
I have tried that the discount rate stays at Zero no matter what unless I change it manually.
Kevin Robertson  @Reply  
           
2 years ago
In the After Update event of the DiscountRate on OrderF Requery the Subform
    OrderDetailF.Requery

Also try the On Current event.

Do you have any other code that could be preventing the field getting the Default Value?
Kevin Yip  @Reply  
     
2 years ago
Here is an example of what can happen, and why a default value is not the best way to do this kind of thing:

Suppose your customer form has 2%, your OrderF shows 2%, so your subform should also show 2%.  That's according to how you set up default values.

If you navigate to different customer that has 4%, your order main form and subform will STILL show 2%.  Navigate to customer with 10%, you will still get 2% on the order forms.  You can do this *forever* and your order forms will show the old default value 2%.

That's because default values are *static*.  It is only calculated *once*: when a *new blank row* is created.

The only way to get rid of 2% is to enter and save the record in the order forms, so Access will create a *new blank record* on the form.  Then and only then will a new default value be calculated based on the current customer.  This is not helpful, because you can't just enter a new record every time you need a new discount.

This is why default values are not good for this purpose.  They are static, and they don't update themselves every second, after every change you make to the customer form.  The only way to get the value at the moment you need, is to calculate it at the moment you need to -- not when you change customer, but when you are actually about to enter a new record on the order subform or mainform.  This is what the BeforeInsert event can do.
Richard Van Wagoner OP  @Reply  
      
2 years ago
I thank you for your help Kevin Robertson, but that does not seem to work either. As far as what you have said Kevin Yip can you tell me where and what to put in the code in before insert event?
Richard Van Wagoner OP  @Reply  
      
2 years ago
When I open the subform by itself without the parent form I get a #Name? error in the discount field does this mean anything?
Richard Van Wagoner OP  @Reply  
      
2 years ago

Richard Van Wagoner OP  @Reply  
      
2 years ago
I just got it fixed. I deleted the subform and started over now it works. Thanks to all.

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

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: 6/17/2026 6:30:29 AM. PLT: 0s