Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    OpenArg (2003 / 2000)

    The OpenArg argument works fine in a DoCmd, but not when I include the Where condition. I get a missing argument or similar error. What's wrong with the following statement (Completed Orders is the OpenArg)?

    DoCmd.OpenForm stDocName, acNormal, , WhereCondition:="Completed = Yes",,,"Completed Orders"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenArg (2003 / 2000)

    You're mixing up two ways of specifying arguments: by position and by name. You must use either one or the other.

    By position (arguments are not named, and commas are used to indicate missing arguments):

    DoCmd.OpenForm stDocName, acNormal, , "Completed = Yes", , , "Completed Orders"

    By name (each argument is named, and no extra commas are needed):

    DoCmd.OpenForm FormName:=stDocName, View:=acNormal, WhereCondition:="Completed = Yes", OpenArgs:="Completed Orders"

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: OpenArg (2003 / 2000)

    Thanks Hans, you saved me once again.

Posting Permissions

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