Yes, building SQL code at runtime is done all the time. Set your basic code to a string then interweave the elements that change depending on your circumstances. Here's an example deleting all incidents in FileName where the ID is above the Limit. FileName and Limit can be set at runtime.
Dim strSQL as string
Dim FileName as string
FileName "MyFile"
Limit = 56
IMHO, neither of these actually 'build' anything. each is a manner of selecting from choices.
It IS possible to actually create code during run time, Refer to "Modules" in help, then review the InsertLines (et al) Method.
I would say that this is SLEDOM done in MS. Access - or any modern language for production applications. The use of this and related techniques were once-upon-a-time common, but are generally discouraged on several grounds, not the least of which is the trouble with debugging code that doesn't exist.
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over
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.