By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,078 Members | 2,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,078 IT Pros & Developers. It's quick & easy.

Command object problem ??

P: n/a
Hi, Folks
Please show me what happen ?
In my Code, I declare: cm as command
the word "command" doesnot capital the first letter like : Command.
And i think VBA doesnot know what is cm ??
But in my office, i can see: cm as Command, and everything do as
my intent (cm is a Command)--->Why ?
Please give me a hand.
thanks in advance.
Luan from VietNam
Jan 26 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I may be wrong but;

If I type;

dim cm as

in a sub I get the option of commandbutton from the listbox but not
command. So I don't think you can declare something as a command
directly. However this works for me;

Dim cm
cm = Command()

What are you trying to achieve?

Jan 26 '07 #2

P: n/a
"luanhoxung" <lu********@yahoo.comwrote in message
<6a******************************@localhost.talkab outdatabases.com>:
Hi, Folks
Please show me what happen ?
In my Code, I declare: cm as command
the word "command" doesnot capital the first letter like : Command.
And i think VBA doesnot know what is cm ??
But in my office, i can see: cm as Command, and everything do as
my intent (cm is a Command)--->Why ?
Please give me a hand.
thanks in advance.
Luan from VietNam
Sometimes it doesn't capitalize, even if it recognizes the object type,
maybe because something else has been named "command" without
capitalization somewhere?

If you're using ADO command, perhaps be explicit, and do

Dim cmd as ADODB.Command

Do you get the Intellisence dropdown when typing cmd. after the
declaration? Does it work?

Do you have the relevant library referenced - for ADO Command, you'll
use Microsoft ActiveX Data Objects 2.# Library where # should be
between 0 and 8, I think.

--
Roy-Vidar
Jan 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.