Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox problem -Runtime error '383' -Text property is read only 2

Status
Not open for further replies.

isha

MIS
Mar 7, 2002
216
IN
There is a combobox having style as dropdown list on one of my forms. When I try to fetch and display some value on the combobox from the recordset it is giving the error as text property is read only. When I change the combox style to 0 or 1 then this problem donot occurs. But I want to keep the style of combobox as 2(dropdown list). Anyone who can help/advise me is welcome.
 
Set the selectedIndex property of the combo to select a row.

Best regards
 
Isha,
Frankly, am confused by the post.. what are u looking for? If it is like "U can drop down, but the user can't type into it, and u need to set text of the combo via code.." then, u need to do something else...

Keep the combo a dropdown, can type and allthose, and in the KeyPress Event of the Combo, set the "KeyAscii=0".

When u do this, the combo acts as a normal combo, with dropdowns and all, u can add an item using .additem method, u can set the text property of the combo to wot u want, but the user wont be able to type on it...

Is this wot u r lookin for? All the Best
Praveen Menon
pcmin@rediffmail.com
 
PraveenMenon,
Your hint has solved my problem to a great extent. But how can I prevent a user so that he can not delete the item displayed in the combo by selecting and pressing delete. Can i prevent this using the Ascii for the Delete Key?
 
Write another line of code in the Combo1_KeyDown Event,

KeyCode = 0

isha.. AM always happy to hear that the problem u had is solved .. All the Best
Praveen Menon
pcmin@rediffmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top