|
-
Feb 22nd, 2001, 04:41 PM
#1
Thread Starter
Addicted Member
How can you lock a combo box so that the user can't delete the name that is shown, but can still select another name?
If it was a textbox, I would lock it, but you can't do that with a combobox and then select another name from the list.
Normal is boring...
 smh 
-
Feb 22nd, 2001, 04:42 PM
#2
Fanatic Member
Set the Style property to 2 - Dropdown List.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 22nd, 2001, 04:46 PM
#3
Either just use a list box , or set the Style to 2 - drop down list
-
Feb 22nd, 2001, 04:46 PM
#4
Thread Starter
Addicted Member
I can't do that because of the following code:
rstOwner.Open "SELECT * from ATMOwnerContacts where OwnerName='" & cboOwner.Text & "';", cnn
cboOwnerContact.Text = rstOwner!contact
txtPhoneNumber = rstOwner!Phone
txtExtension = rstOwner!extension & ""
txtFaxNumber = rstOwner!fax
txtEmail = rstOwner!Email
I get the error 'Read Only'.
Normal is boring...
 smh 
-
Feb 22nd, 2001, 04:50 PM
#5
Try this:
Code:
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
-
Feb 22nd, 2001, 04:55 PM
#6
Thread Starter
Addicted Member
That worked great with one exception.
What if they highlight the word and then press delete? It does delete then.
Any suggestions on how to prevent that?
Normal is boring...
 smh 
-
Feb 22nd, 2001, 04:55 PM
#7
Fanatic Member
Try this smh....
Code:
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 22nd, 2001, 04:58 PM
#8
Thread Starter
Addicted Member
Thanks guys...it works great!
Normal is boring...
 smh 
-
Feb 22nd, 2001, 04:59 PM
#9
Fanatic Member
Found another problem smh, if the user highlights the text and presses the space bar the text can still be deleted.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 22nd, 2001, 05:04 PM
#10
Fanatic Member
Nevermind I did something stupid!!
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|