Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100

    Unanswered: 2135 property read-only

    Hi people,

    I am having problems setting the property text of a text box.
    When I set the property for the first time, no problem. But then when I change the property in the same function, same line of code, it gives me an error: "2135 this property is read only and can't be set"

    I think this problem is common for a lot of people.

    Any help?

  2. #2
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Hi Friend,

    Can you show us the line of code that you are using to set the property. probably the whole function will help!

    Regds

  3. #3
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100
    Originally posted by aqua_zinc
    Hi Friend,

    Can you show us the line of code that you are using to set the property. probably the whole function will help!

    Regds
    Of course! Here you have:

    Me.ArrivalDay.Text = Day(ListItem.Subitems(2))

    Some explanations more: when I load the form, I call this function to fill text boxes from a controlListView. This works well, but then I call again the function when you click in the listbox and another item is highlighted, then the error appears
    Last edited by pipeio; 04-09-04 at 10:18.

  4. #4
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Instead, use

    Me.ArrivalDay = Day(ListItem.Subitems(2))

    See if it works..

    Remove the ".Text" part

  5. #5
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100
    Originally posted by aqua_zinc
    Instead, use

    Me.ArrivalDay = Day(ListItem.Subitems(2))

    See if it works..

    Remove the ".Text" part
    Ok, it works, I thought that Me.ArrivalDay and Me.ArrivalDay.Text are different. I can see that with .Text is a string.

    Thanks a lot.

  6. #6
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Hi Friend,

    Just an additional info.

    .TEXT works fine as long as the control has focus. If you have to assign the value to the text box anywhere else in the code, never use the .text property. Hope it helps !

  7. #7
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100
    Originally posted by aqua_zinc
    Hi Friend,

    Just an additional info.

    .TEXT works fine as long as the control has focus. If you have to assign the value to the text box anywhere else in the code, never use the .text property. Hope it helps !
    Yes! it helps. But I wanted to changed the .text property cause I want to use the onChange event. This event occurs when the text property has changed. And sometimes it happens without give the focus to the text box (by means of a calendar).
    That's why I wanted to use this property.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •