• dim as control (Access 97)

    Author
    Topic
    #366672

    i was just wondering if there was a way to dim a string value, such as “Forms!Form1.Text1” as a control to reference later to enter a value? I can provide more information if needed, but i would just like this simple question answered. thanks in advance

    Viewing 0 reply threads
    Author
    Replies
    • #569364

      It isn’t clear what you want to do. You can declare an object variable as a control, but the way you set it will depend on where you’re setting the object variable. In any event, you would need the name of the control and the name of its parent form as separate strings so that you could later say:

      Set objCtl = forms(strFormName)!(strControlName)

      • #569418

        thanks a bunch charlotte! it worked fine!

        however, i had to remove the “!” from the statement because it was giving me some kind of error. the statement
        Set objCtl = forms(strFormName)(strControlName) worked perfectly.

        thanks again

        • #569422

          Sorry about that, it’s one of the problems with air code. blush The syntax is analogous to DBEngine(0)(0) referring to the default workspace and current database. You need punctuation only if you reference the specific collections by name (i.e., DBEngine.Workspace(0)).

          • #569648

            wow!
            again i am awed by the amount of knowledge you have in that brain of yours. i will pretend that i know exactly what you are talking about after your blushsmiley ). you have helped me several times in the past and i would like to thank you once again for gettimg me out of a tight spot )

    Viewing 0 reply threads
    Reply To: dim as control (Access 97)

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

    Your information: