Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Big Button Form 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Big Button Form Part 3
Normand Caron 
      
14 months ago
I GET AN ERROR ON THIS Followinf STATEMENT:
    Set rs = CurrentDb.OpenRecordset(TempVars("ButtonRecordSource"))

What is wrong with the Statements it is as Big Button Form Part 3
Normand Caron OP  @Reply  
      
14 months ago
Mispelled, ponctuation OR Resered word type error.
Normand Caron OP  @Reply  
      
14 months ago
Private Sub Form_Open(Cancel As Integer)
    Dim rs As Recordset
    Set rs = CurrentDb.OpenRecordset(TempVars("ButtonRecordSource"))
    While Not rs.EOF
    
        MsgBox rs!ButtonCaption
        
        
        rs.MoveNext
    Wend
    rs.Close
    Set rs = Nothing
Normand Caron OP  @Reply  
      
14 months ago
The following is the error message
Normand Caron OP  @Reply  
      
14 months ago
x

Sami Shamma  @Reply  
             
14 months ago
If you msgbox the tempvars, what do get?
Normand Caron OP  @Reply  
      
14 months ago

Normand Caron OP  @Reply  
      
14 months ago
What arguments am i missing?
Kevin Robertson  @Reply  
           
14 months ago
If you click Debug what line of code is highlighted?
Normand Caron OP  @Reply  
      
14 months ago
Set rs = CurrentDb.OpenRecordset(TempVars("ButtonRecordSource"))
Normand Caron OP  @Reply  
      
14 months ago
For some reason i cannot get past the above set rs line.
Kevin Robertson  @Reply  
           
14 months ago
Go to the where the TempVars() is set. Check your spacing.

I just ran a test by removing the space before the line continuation and I got the same error message (your first screenshot). I'm thinking that may be the problem.
Normand Caron OP  @Reply  
      
14 months ago
i got the exact spacing as the video and i'm still getting the error.

Private Sub Form_Open(Cancel As Integer)

    Dim rs As Recordset
    
    Set rs = CurrentDb.OpenRecordset(TempVars("ButtonRecordSource"))
    While Not rs.EOF
    
        MsgBox rs!ButtonCaption
        
        rs.MoveNext
    Wend
    rs.Close
    Set rs = Nothing
    
End Sub
Kevin Robertson  @Reply  
           
14 months ago
The TempVars() is set in the Select Vehicles Button.

TempVars("ButtonRecordSource") = "SELECT VMakeID As ID, VMakeName as ButtonCaption " & _
        "FROM VMakeT ORDER BY VMakeName"
Normand Caron OP  @Reply  
      
14 months ago
You were right the problem was with the SQL statement. I corrected it.
Thank you very much for your help..
Kevin Robertson  @Reply  
           
14 months ago
You're welcome.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Big Button Form 3.
 

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/22/2026 12:53:26 AM. PLT: 0s