Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Invoicing > < Switch Function | Templates >
 
Invoicing
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   17 months ago


Back to Invoicing
 

Expected End Sub Upload Images   Link  
Ben Harosh 
11 months ago
Hi,
I came to the video:
https://www.youtube.com/watch?v=NOZ9z-9a46w
And I performed all the steps.
As soon as I click on the "Add" button I get the following error:
compile error:
Expected End sub

Attaches the code I wrote in my database:

Option Compare Database
Explicit option

Private Sub AddBth_Click ()

Private Sub Addbutom_Click ()

    If IsNull (ProductCombo) Then
        DoCmd.GoToControl "ProductCombo"
        ProductCombo.Dropdown
        Exit Sub
    End If
        
    DoCmd.GoToRecord,, acNewRec
    ProductID = ProductCombo
    Productname = ProductCombo.Column (1)
    UnitPrice = ProductCombo.Column (2)
    Notes = Nz (DLookup ("Notes", "ProductT", "ProductID =" & ProductCombo), "")
    Me.Refresh
        
End Sub
Alex Hedley
11 months ago
Private Sub AddBth_Click ()
End Sub

Private Sub Addbutom_Click ()
. . .
End Sub
Alex Hedley
11 months ago
Careful of your spelling

Did you rename the button at some point?
Ben Harosh
11 months ago
No, but I tried to do it a few times (I deleted and returned the button)
Alex Hedley
11 months ago
When you delete the button from the Form view you also need to clean up your VBA.
Richard Rost
11 months ago
Hi Ben. Yes, you answered your very own question when you typed it in. The compiler said "expected: End Sub." You are missing the End Sub from the first Sub you started in your code. Programming requires very specific syntax. I'd suggest watching my Intro to VBA video and perhaps at least the first couple Access Developer classes if you're serious about modifying the VBA in my templates.

This thread is now closed. If you wish to comment, start a NEW discussion, below.
 


Back to Invoicing Comments
 

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

6/30/2022Sales Chart
6/27/2022Rounding Errors
6/26/2022Calendar Seminar Students Only
6/24/2022Multi Combo One Field
6/23/2022Modal & Popup
6/21/2022Week of Year
6/16/2022Value List Combo
6/15/2022Weekday
6/14/2022Project Budgets
6/14/2022Find Record
 

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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn