Well that's funny. Another answer to my own question:
Sub cmboCompanyName_AfterUpdate()
Dim strNewRecord As String
strNewRecord = "SELECT * FROM Customers " _
& " WHERE CustomerID = '" _
& Me!cmboCompanyName.Value & "'"
Me.RecordSource...
To answer my own question see below. Are there any better ways of doing this? Can I change the Query object a report uses dynamically/supply SQL?
See http://www.databasejournal.com/features/msaccess/article.php/1556051 for the source of this code.
Option Explicit
Option Compare Database...
Hi,
I've got a number of variations on the same report. I don't want to recreate/copy the same report X times. I'd rather change the SQL via code. Is this possible?
Could someone post a snippet of code to get me started.
Thanks,
-Swoop
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.