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 
Help with Invoicing Template
John Schreiber 
      
9 months ago
I am using the Free Invoicing template that Richard made available to us. I intend to put a button the Main Menu that will add a new record on the OrderF/OrderDetailF. First, I will have the button open a Popup/Modal form.  This form will allow me to select a customer with a with Combo Box. Then its button will be enabled. When this button is pushed it will open the OrderF to the customer selected from the Combobox. However, since this will be a new order, I want the OrderDetalF subform to open directly to a new record. How can I code my VBA. Actual code would be helpful but reference to any lesson below developer level 42 would also work. Thanks
Kevin Robertson  @Reply  
          
9 months ago
Just open OrderF to a new record and set the focus to the Subform.

    DoCmd.OpenForm "OrderF", , , , acFormAdd
    Forms!OrderF!OrderDetailF.SetFocus
Raymond Spornhauer  @Reply  
          
9 months ago
John

I would start by saying that adding unnecessary complexity to your database will only make it more challenging for you in the future if/when things don't work due to future changes in your database.  If you're going to open a Form to select the Customer, why not just use the database the way it is?  (Rhetorical question)

You could just as easily add a customer combo to your main form with a button that only appears after a customer is selected instead of having a Popup/Modal Form.  (Popup/Modal Forms can be challenging to work with)

============================================
To answer your question:

The VBA for the Button on your main Form will be:  DoCmd.OpenForm "Popup/Modal Form"

Once your Popup Modal Form is Open... you'll have the combo box setup the same as the one in the Order Form.  

Once the user has selected the customer, they should have 2 buttons... a Cancel Button, which will just close the form...

Then an "Order" button which will do the following:
1. Open the Order Form, the VBA will look like this: DoCmd.OpenForm "OrderF", ,"CustomerID="CustomerID, acFormAdd
2. DoCmd.Close acForm, Me

You might have a problem doing this this way as I don't know if VBA can open the Order Form with a Popup/Modal Form open.

-Raymond
John Schreiber OP  @Reply  
      
9 months ago
Thaks folks. About an hour after I sent this I realized I did not need to get this complicated. But, you did show how to reference the sub form. And that I thank you for.
Kevin Robertson  @Reply  
          
9 months ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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/1/2026 7:22:27 PM. PLT: 1s