Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Openargs (access 97)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Openargs (access 97)

    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"
    Francois

  3. #3
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Openargs (access 97)

    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

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Openargs (access 97)

    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.
    Francois

  5. #5
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Openargs (access 97)

    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

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Openargs (access 97)

    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.
    Francois

Posting Permissions

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