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

Change combobox to textbox in vba

P: 16
Hi I was trying to use this code to change a combo box to a text box :
Me.cboEntry.value = ""
Me.cboEntry.SetFocus
DoCmd.RunCommand acCmdChangeToTextBox

But when i run the application it gives error
Runtime error '2046'
The commant or action "ChangetoTextbox" is not available now

Can anybody help me to do this

"I know i can use alternative method, By putting textbox on top of combobox and making invisible one of them"

But i want to do this in a clean way
Thanks in advance
Sep 4 '08 #1
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
My guess is that you're trying to do this while the form is running, and this kind of design change can only be made if the form is opened in Design View.

Linq ;0)>
Sep 4 '08 #2

NeoPa
Expert Mod 15k+
P: 31,494
Cleanliness and neatness of code is always very important IMHO.

In this case, if I understand your requirements correctly, keeping (and managing) the TextBox as separate from the ComboBox seems a neater solution to me. I assume you don't want simply to disable the ComboBox on the fly. That would disable the ComboBox facility while at the same time show the selected result. Unfortunately it's also somewhat greyed out, so half hidden. Not an ideal solution.
Sep 5 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
What exactly are you trying to accomplish with this?

Linq ;0)>
Sep 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.