Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Read Only Unbound Input Boxes (2000/SP 2)

    Is there any way to change the read-only property of an unbound text box? I have an unbound text box on a form. There is code behind a cmd button that attempts to make the data in the unbound box the same as the data in a bound test box on the form. Every time the code is run an error comes up stating "This property is read-only and can't be set".

    Thank you,
    Leesha

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Something in your code is not right - you should always be able to change the value of an unbound text box. Post the code you are using and we'll see if we can find something wrong.
    Wendell

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Hi Wendell,

    I have tried various things. These are the ones that gives me the read-only error I mentioned:
    [NAME] = [FULL NAME LNF]
    Me.NAME = Me.FULL_NAME_LNF

    This one gives me a message stating "Invalid qualifier"
    Me.NAME.Value = Me.FULL_NAME_LNF.Value
    NAME is yellowed out in the debug screen. NAME is the name given to the unbound text box.

    Thanks for you help,
    Leesha

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Your problem is that NAME is a reserved word in Access and in VBA. One of the cardinal rules of Access development is not to use such things as DATE, NOW, NULL, and other similar words as the name for fields, controls or variables. If you change your code to read
    Me!NewName = Me!Full_Name_LNF
    then things should work like a champ (that presumes you are running the code behind a form so you can use Me!).
    Wendell

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Thank you!!! That's what happens when one is self taught!! You don't necessarily know all the cardinal rules. And yes, the code is is behind a form :-)!

    I'll give it a shot.

    Leesha

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Just to expand on Wendell's explanation, Name is a built in property of Access objects like Forms, Reports, Controls, etc., so when you refer to Me.Name, Access thinks you are trying to set the name of the object, in this case the current form.
    Charlotte

  7. #7
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Read Only Unbound Input Boxes (2000/SP 2)

    Hi Charlotte and Wendell

    Well it worked and I'm thrilled! Thanks for the info!!

    Leesha

Posting Permissions

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