 |
 |

11-22-2006, 07:41 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
Locking DBCombo Box
|
I need to lock the DbCombo text box so no one can enter anything but they can use the Drop down list. How do I go about this? I tried making the Locked property True but it disabled the Drop down list, I couldnt pick any item from the drop down list. Please could you assist me.
thank you
|
|

11-22-2006, 08:09 AM
|
 |
Green-Eyed
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
|
|
|
What software are you developing in...
|
|

11-22-2006, 08:14 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
|

11-22-2006, 08:22 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: NC, USA
Posts: 470
|
|
Quote:
|
Originally Posted by nkechifesie
I need to lock the DbCombo text box so no one can enter anything but they can use the Drop down list. How do I go about this? I tried making the Locked property True but it disabled the Drop down list, I couldnt pick any item from the drop down list. Please could you assist me.
thank you
|
Set the Style Property to 2 - dbDropdown List.
|
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ---Rich Cook
|

11-22-2006, 08:32 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
|

11-22-2006, 08:58 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: NC, USA
Posts: 470
|
|
Quote:
|
Originally Posted by nkechifesie
It still didnt work.
|
What didn't happen that you expected to happen? Setting the Style Property to 2 will allow a user to choose something from the list, but will not allow them to enter anything that is not on the list.
Maybe I didn't understand your problem... 
|
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ---Rich Cook
|

11-22-2006, 09:00 AM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
It's a DBCombo, not a regular combobox.
|
__________________
~ Quod non mortiferum, fortiorem me facit ~
Avatar by lebb
|

11-22-2006, 09:23 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: NC, USA
Posts: 470
|
|
Quote:
|
Originally Posted by reboot
It's a DBCombo, not a regular combobox.
|
My apologies. I did understand that. I am familiar with the property in a regular combo box, and MSDN says:
Code:
[b]vbComboDrop-DownList[/b] value - 2 Dropdown List. This style allows selection only from the drop-down list.
Although I did not test it, I thought it should work 
|
__________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ---Rich Cook
|

11-22-2006, 09:26 AM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
I just wanted to point that out. I've never used one and have no idea if they have similar properties or not. If they do, your answer should indeed be correct.
|
__________________
~ Quod non mortiferum, fortiorem me facit ~
Avatar by lebb
|

11-23-2006, 01:36 AM
|
|
Regular
|
|
Join Date: Nov 2006
Posts: 62
|
|
Quote:
|
Originally Posted by PianoMan
My apologies. I did understand that. I am familiar with the property in a regular combo box, and MSDN says:
Code:
[b]vbComboDrop-DownList[/b] value - 2 Dropdown List. This style allows selection only from the drop-down list.
Although I did not test it, I thought it should work 
|
Dont mind me, I still locked the text box before i did what you asked me to. i have unlocked it and did as you bidded and it worked. thank you very much. Sorry about the confusion.
|
|

11-23-2006, 05:47 AM
|
 |
Newcomer
|
|
Join Date: Jun 2005
Location: Staffordshire, England
Posts: 15
|
|
It doesn't matter if its a standard ComboBox or a DBCombo you still set the Style to 2 at DesignTime. This will stop the user typing into it. 
|
__________________
I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
http://www.martin2k.co.uk/forums/
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|