Results 1 to 2 of 2
  1. #1
    clchris_80 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Posts
    6

    DoCmd.Close OpenArgs NOT WORKING

    I am trying to open a Form from a report that will allow you to add another incident onto the same record. This requires the new form when it opens to have some but not all of the new fields to be auto populated so that the ID is the same and they all stay linked. My open arguments don't seem to be working though I copied them DIRECTLY from Microsofts example and changed the name. The form opens but nothing populates. Here is what I've tried so far.

    Private Sub Command19_Click()
    DoCmd.OpenForm "IncidentDetails", acNormal, , , acFormAdd, acWindowNormal, _
    EventID = Reports!IncidentFocus!EventID


    End Sub

    I've also tried:

    Private Sub Command19_Click()
    DoCmd.OpenForm "IncidentDetails", acNormal, , , acFormAdd, acWindowNormal, _
    "EventID =" & [Reports]![IncidentFocus]![EventID]
    End Sub

    I've tried a few others but they aren't even worth mentioning. Please Help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Want to provide link to the example source?

    Should title of this thread be 'DoCmd.OpenForm OpenArgs NOT WORKING'?

    That button is on what form?

    The second example you show should pass a string value in OpenArgs like: "EventID=473"

    Then code in form IncidentDetails must extract the string from OpenArgs and do something with it. Looks like should set the Filter property of IncidentDetails form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-05-2013, 04:32 PM
  2. Close Form button not working
    By RedGoneWILD in forum Forms
    Replies: 2
    Last Post: 06-25-2012, 07:02 AM
  3. Replies: 1
    Last Post: 11-28-2011, 04:06 PM
  4. DoCmd.OutputTo not working
    By arunkumar213 in forum Access
    Replies: 1
    Last Post: 09-08-2011, 10:41 PM
  5. docmd.runsql not working
    By Rameez in forum Programming
    Replies: 3
    Last Post: 08-07-2009, 10:07 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