• Openargs (access 97)

    Author
    Topic
    #363918

    could someone please tell me why this does not work, and what i can do to make it work?

    (assuming me.openargs = Forms!Form1.Text1)

    dim ctl as control
    set ctl = me.openargs
    ctl.value = “It Worked!!!”

    (if i put set ctl = Forms!Form1.Text1 in directly, it works, but the other way it says “object required” or something like that)

    thanks in advance

    Viewing 0 reply threads
    Author
    Replies
    • #556945

      If ctl is a textbox then

      me.ctl = me.openargs

      no need to dim as the control exist on the form.
      Form has to been opened with the openarg. Something like :
      docmd.OpenForm(“categories”),,,,,,”test”

      • #556946

        the control in which i am referencing is on another form…

        i understand the process of using openargs, but i need to assign the value of openargs as a control

        thanks

        • #556947

          I’m not sure of what you want to do but the openarg can only contain a string. Not a control.
          See OpenForm Method in the help file.

          • #556952

            here is what i am doing…

            i have several forms with a date entry text box
            i use another form with a calendar control to simplify the date entering process.
            using a command button on one form, i open the calendar form to get a date. since there are several places that i could be requesting a date from, i need the calendar to know where to put the date when i select it.

            say the text box on the first form (Form1) that accepts the date is called Text1
            when the command button is pressed and the calendar form is opened, i want openargs for the calendar to reference the text box (Forms!Form1.Text1)

            i understand that it can only hold in the form of a string, but i should be able to convert that somehow and assign a control to that value. if i set the openargs to Forms!Form1.Text1, isnt there a way to assign that to a control variable?

            i hope this cleared up my situation

            • #556953

              Open the calendar form with the name of the form in the openarg.

              DoCmd.OpenForm (“frmCalendar”), , , , , , Me.Name

              In the On Close event of the calendar form pass the date of the calendar to the form in the openarg.

              Forms(Me.Openargs)!DateControl = Me!CalenderControl.Value

              Should be working.

    Viewing 0 reply threads
    Reply To: Openargs (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: