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 Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Top Value SQL statement
eddy geijselaers 
    
15 years ago
Hello Richard,
I have a form that has a listbox which I try to fill with the selection made by drilling it down by selecting from a couple of textboxes.

the comand is:
TopWijnLijst.RowSource = "SELECT etc"
which is triggerd by clicking a command button.

Yes, I stole the SQL from a query. but since the TOP Values cannot be part of the query command the "peanuts" can build (no field for in the query). I had to add the "TOP 25" after the "SELECT " as Access does too.

Problem I run into when pasting this line of SQL into the VBA-code of the SelectButton: (due to translation it could be not exactly, hope you understand)
"compile error: expecting end of instruction"
Running it from the Form:
"Compile error:  syntax error"
After trying to cut the lines with your normaly funtioning &_ or _:
In the second line of code starting now with the FROM clause:
"Compile error: expected )" on the first INNER - which I do not understand at all.

Whatever I try this last message keeps poppin up.

Thanks for looking into this,

eddy "peanut"


This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access 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/17/2026 4:21:23 PM. PLT: 0s