Hi Mike,
> strX = "CategoryID"
> strQuery = "Select" _
> & "strX" _
> & "From Products"
Right after that line add this:
Debug.Print strQuery
That will print out the SQL statement in the debug window.
If the debug
window isn't visible it'll pop up for you. If it still
doesn't pop up,
use CTRL+G. I don't even compile many of my VB6 creations
anymore, I
just do everything from the debug window (since it's mostly
used as a
super-powerful string manipulation tool anymore).
Anyway... The statement should appear as:
SelectstrXFrom Products
No spaces, and the variable name, being wrapped in quotes,
is treated as
a literal string, so it won't be interpreted. It should be
like this:
strQuery = "Select " _
& strX _
& " From Products"
Note the addition of spaces and the removal of quotes from
around the
strX variable.
> If a had a little more hair to spare, I think I would
> pull it out.
Hehehehe. The sample above ought to get you there.
> P.S. Thanks for the Plumbing analogies.
A pleasure.
Regards,
Shawn K. Hall
http://12PointDesign.com/
a>
http://ReliableAnswers
.com/VB/
'// =======================================================
Rules : http://Reli
ableAnswers.com/List/Rules.asp
Home : http://groups.y
ahoo.com/group/vbHelp/
=======================================================
Post : vbHelp@yahoogroups.com
Join : vbHelp-subscribe@yahoogroups.com
Leave : vbHelp-unsubscribe@yahoogroups.com
'// =======================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.y
ahoo.com/group/vbhelp/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://grou
ps.yahoo.com/group/vbhelp/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:vbhelp-digest@yahoogroups.com
mailto:vbhelp-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
vbhelp-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|