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 
Updating Main Form from a Popup Form
David 
    
15 years ago
I have a query which joins three tables, a main table called AppointmentsT, and two small tables one called ExtrasT and the other DepositsT. The AppointmentsT table has an autonumbered ID field which is linked on a one to one basis to numbered IDs on both of the two small tables. I only occasionally need to use the small tables, on about 5% of occasions, which is why they are small tables linked to the main table rather than having their fields embedded in the main table - size considerations!
There are three Forms based on those tables (same names with F instead of the T), and the two small tables are popup forms accessible only from the main form by a button.
The pop up forms contain fields which need to be reflected in calculated fields of the main form. Fields that calculate the total value taken from the main and pop up forms (where they exist) and another field that concatenates strings taken from one of the pop up forms where those strings exist.
I can only access the pop up forms from buttons on the main form which take me to the related pop up form.
When I close the pop up forms, which have to be closed by using a small button before the Main Form can be closed, and despite having a procedure in the on click event of the button used to close the pop up form (namely: If Me.Dirty And Nz(Me!CustomerName, "") <> "" Then DoCmd.RunCommand acCmdSaveRecord) I cannot get the Main Form to show the recalculated values.
Bizarely if I make entries in the Main Form and then open the popup Form and make entries, the entries are saved to their respective tables when I close those popup forms but are not showing in the Main Form although when it is closed the entries do show in the underlying main table and when I reopen the Main Form the results are correctly displayed and have been properly calculated in the query.
Even more bizarely if I close the Main form and then reopen it, and then use the popup forms, the entries are again not displayed in the Main form after I close the popup forms.
But, and this is the quirk, if I make an entry in the popup Form and then close it and then close the main form, when I next open the main form not only are the calculations and concatenations correctly displayed, if I make alterations to those calculations and concatenations in the popup form the alterations are simultaneously displayed in the Main Form.  That is what I would like to happen all the time, but it only happens after I have made an entry in the popup form, closed the popup form, closed the main form and then reopened the main form followed by the popup form.

I think I have worked out what may be the problem, but I am not sure how to solve it.
The data on the main form has not been saved before I open the pop up form, and if it and the data on the popup form has been saved then everything works just fine, but if it has not, then I have a problem, so how do I save the data entered into the main form first and make sure that when I enter data in the popup form it is always displayed in the main form?

However that solution does not cater for the case where I have closed and reopened the Main form before using the popup form.

Any suggestions anyone?
Thanks
David

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/18/2026 2:48:46 AM. PLT: 2s