Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running sql in vba 1

Status
Not open for further replies.

krymzon

Programmer
Joined
Feb 22, 2005
Messages
38
Location
CA
ok, i want to make the source of a combo box come from some sql code that i write.this is easy enough, the question i have is when i write out the sql code in the vba environment, can i reference form objects (like a text box, etc) inside my sql code?
remeber that this SQL code will not be executed from a query, but will be executed locally inside the vba environment once a button is activated.
 
I usually put the form object into a local variable then use that variable in the SQL. This makes debugging easier and also means that I can do things like trimming off any spaces or forcing the value into uppercase before using it.

Geoff Franklin
 
So long as they are accessible. If you create the SQL string in the Click Event of a button, then all of that form's controls are available to you.
 
awesome, thanks alot guys. i'll try the local variable technique because i will eventally have to use some string functions on it.

i swear, if i didn't have this web site for access help, i'd be lost...i miss using my as/400 and SQL, lol. i'm a young guy, but i'm an old school programer at heart

<i>there are 10 people in this world. those who know binary, and those who don't.</i>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top