423,846 Members | 2,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,846 IT Pros & Developers. It's quick & easy.

Run Time error '383' 'Text' property is read-only

lotus18
100+
P: 866
Hello everyone!!!

I have a problem in retrieving starttime and the endtime values. Can anyone help me to solve this problem? Here's my sample codes:

Expand|Select|Wrap|Line Numbers
  1.  
  2. '==================
  3. from frmSchedules
  4. '==================
  5.  
  6. SetConnection
  7. CheckConnection rs
  8.     rs.Open "Select * From LoadSchedules Where ScheduleID='" & ID & "'", _
  9.     adConnection, 1, 1
  10.     With ScheduleEntry
  11.         .txtScheduleID.text = rs!ScheduleID
  12.         .txtCourse.text = rs!Courses
  13.         .txtSection.text = rs!Sections
  14.         .txtSemester.text = rs!Semester
  15.         .cboSubjectCode.text = rs!SubjectCode
  16.         .txtDescription.text = rs!Description
  17.         .cboRoom.text = rs!Rooms
  18.         .cboDay.text = rs!Days
  19.         .cboStartTime.text = rs!StartTime   '<-----Run Time error '383' 
  20.         .cboEndTime.text = rs!EndTime      '<-----Run Time error '383' 
  21.         .Show 1
  22.     End With
  23.  
  24. '==================
  25. from frmScheduleEntry
  26. 'adding items to the starttime and endtime comboboxes
  27. '==================
  28.  
  29. Sub LoadStartTime()
  30.     Dim t As Date
  31.     Dim i As Integer
  32.     t = CDate("07:00:00")
  33.     Do
  34.         t = DateAdd("n", 30, t)
  35.         cboStartTime.AddItem Format(t, "h:mm AM/PM")
  36.         i = i + 1
  37.     Loop Until i >= 26
  38. End Sub
  39.  
  40. Sub LoadEndTime()
  41.     Dim t As Date
  42.     Dim i As Integer
  43.     t = CDate("07:30:00")
  44.     Do
  45.         t = DateAdd("n", 30, t)
  46.         cboEndTime.AddItem Format(t, "h:mm AM/PM")
  47.         i = i + 1
  48.     Loop Until i >= 26
  49. End Sub
  50.  
I check the data of start time and the end time in the table and it matches with the items on the comboboxes. I don't know why this error occurred.
Nov 20 '07 #1
Share this Question
Share on Google+
2 Replies


AHMEDYO
100+
P: 112
HI..

i think that you trying to set Text property value in Combo Box control, then this error appear because you set Style property to "2" = DropDownList, this style disallow change of text property, you can change style to any other style, or instead if your data withing the combo box list you can use ListIndex property to select this item.


Best Regards
Nov 20 '07 #2

lotus18
100+
P: 866
HI..

i think that you trying to set Text property value in Combo Box control, then this error appear because you set Style property to "2" = DropDownList, this style disallow change of text property, you can change style to any other style, or instead if your data withing the combo box list you can use ListIndex property to select this item.


Best Regards
Hi

I tried these codes to my other programs and it work. My combobox style property = 2 (DropDownList) and the items of the combobox was retrieved from the database. But now, the items from the combobox are adding during run time. Well, I guess I need to use the ListIndex Property
Nov 20 '07 #3

Post your reply

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