Computer Learning Zone CLZ Access Excel Word Windows

The bigger the smile, the sharper the knife.

-48th Rule of Acquisition
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Microsoft Access 324    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |

Shams Momin 

15 years ago
Hi Richrard I Create Loan Amotization Db by fowlloing you and I type vb code as yors bellow
Option Compare Database
Option Explicit

Private Sub Command36_Click()

    CreatePayments

End Sub


Private Sub CreatePayments()

    ' CHECK FOR EXISTING PAYMENT FIRST!!!!!!
        
    Dim StartDate As Date
    StartDate = InputBox("Start Date", , Date)
    
    Dim db As Database
    Dim rs As Recordsets
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("LoanPaymentT")
    
    Dim X
    For X = 1 To NumberOfMonths
        rs.AddNew
        rs!LoanID = LoanID
        rs!Paymentdate = StartDate
        StartDate = DateAdd("m", 1, StartDate)
        rs!paymentamount = MonthlyPayment
        rs.Update
   Next

   rs.Close
   db.Close
   Set rs = Nothing
   Set db = Nothing

Me.Requery

    
            
End Sub
But I got this Error Compile Error: Variable not Defined


Reply from Richard Rost:

Which variable is not defined? Does the debugger stop on a specific line. Remember, if you have the line "option explicit" at the top of your VBA window, you HAVE to DIM each of your variable.s

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

Next Unseen

 
 
What's This?

 

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: 11/15/2026 8:45:34 AM. PLT: 0s