• Read Only Unbound Input Boxes (2000/SP 2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Read Only Unbound Input Boxes (2000/SP 2)

    Author
    Topic
    #388226

    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

    Viewing 0 reply threads
    Author
    Replies
    • #680693

      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.

      • #680698

        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

        • #680704

          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!).

          • #680707

            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

            • #680724

              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.

            • #680727

              Hi Charlotte and Wendell

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

              Leesha

    Viewing 0 reply threads
    Reply To: Read Only Unbound Input Boxes (2000/SP 2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: