Results 1 to 3 of 3
  1. #1
    Ekhart is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    80

    DoCmd.OpenForm with multiple macros

    I have a couple of different macros that combine to make a filter I want run with the DoCmd option. I can get either to run individually but cannot seem to get the code to work to combined them.



    Code:
    DoCmd.OpenForm "frmActionNeeded", acFormDS, , testingmacro
    works, but if I try
    Code:
    DoCmd.OpenForm "frmActionNeeded", acFormDS, , testingmacro & strRange
    it does not.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the 3rd argument is the WHERE clause, it must look like sql
    DoCmd.OpenForm "frmActionNeeded", , , "[field] between #1/1/17# and #2/1/17#"

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presuming those return valid strings, try

    DoCmd.OpenForm "frmActionNeeded", acFormDS, , testingmacro & " AND " & strRange

    If that doesn't work, it would help to know what the variables contain.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd.OpenForm with 2 Where Conditions
    By CharissaBelle in forum Programming
    Replies: 3
    Last Post: 10-19-2016, 09:32 AM
  2. Docmd.openform (date) and (text)
    By sovereign in forum Forms
    Replies: 3
    Last Post: 06-19-2015, 08:07 AM
  3. DoCmd.OpenForm Syntax Error
    By alsoto in forum Forms
    Replies: 3
    Last Post: 02-29-2012, 01:14 PM
  4. What actually happens at docmd.openform
    By Beorn in forum Programming
    Replies: 4
    Last Post: 01-05-2011, 02:19 PM
  5. DoCmd.OpenForm Modification
    By alsoto in forum Forms
    Replies: 6
    Last Post: 05-01-2009, 07:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums