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 
Access Advanced 2 with vba
Reynaldo Valencia 
   
4 years ago
Hello, where can I find the equivalent to the Access Advanced 2,  "01. Add New Order Button" Add a new order button to get the id of the parent form, but instead of using macros, using vba. Thanks
Kevin Robertson  @Reply  
           
4 years ago
The equivalent in VBA of the Macro in that lesson is:

DoCmd.OpenForm "OrderF", , , "CustomerID=" & CustomerID
DoCmd.GoToRecord acDataForm, "OrderF", acNewRec


Docmd.OpenForm and GoToRecord are both covered in Access Developer 1.
Scott Axton  @Reply  
        
4 years ago
There isn't a direct 1 to 1 video like in the Adv2 lesson.  I was all set to point you to the index but...

Richard has covered it in a couple of other areas though not that same exact example.  It's all about the Legos.
Whether you "Add New... (Customer, Order, Invoice Item, Appointment, etc) the process is the same.

Here are a couple of videos to get you started.  See if that gets you where you want to go.  
Hint look at the Advanced 2 #1 video again pay attention to the 'process'.

Add Records Automatically

Invoicing
Alex Hedley  @Reply  
           
4 years ago
There's a button you can press to convert a macro to VBA
Reynaldo Valencia OP  @Reply  
   
4 years ago
Thansk, I converted the Macro to Visual Basic, the end result was this:

Function Macro1()
On Error GoTo Macro1_Err

    If (IsNull(Forms!OrderF!OrderID)) Then
        DoCmd.OpenForm "OrderF", acNormal, "", "", , acNormal
        DoCmd.GoToControl "OrderDate"
        Forms!OrderF!OrderDate = Now()
        DoCmd.RefreshRecord
        DoCmd.GoToControl "OrderDetailF"
        DoCmd.GoToControl "ProductName"
    End If


Macro1_Exit:
    Exit Function

Macro1_Err:
    MsgBox Error$
    Resume Macro1_Exit

End Function
Reynaldo Valencia OP  @Reply  
   
4 years ago
The "Convert to visual basic" button was disabled, I followed this post to solve it: https://www.office-forums.com/threads/solved-in-access-2010-convert-macros-to-visual-basic-is-grayed-out.2085243/

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/6/2026 8:27:21 AM. PLT: 1s