Results 1 to 4 of 4
  1. #1
    greatwhite is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2019
    Location
    Ottawa, ON
    Posts
    56

    Passing Parameter to Report

    Hi There again



    Below is my Stored Query and below that is my Sub to call it and pass a value.

    I am trying the Where Clause and cannot seem to get the report to accept the value. The query just returns everything

    SELECT tblECs.EC_ID, tblECs.EC_Num, tblECs.EC_Title, tblECs.EC_Rev, tlkpEventType.EventType, tlkpEventStatus.Status, tblShips.ShipName, Count(tblAffectedTDP.EC_ID) AS Num_Affected, tblShips.Ship_ID
    FROM tblECs INNER JOIN tblAffectedTDP ON tblECs.EC_ID = tblAffectedTDP.EC_ID, tlkpEventStatus INNER JOIN (tlkpEventType INNER JOIN ((tblShips INNER JOIN tblEventList ON tblShips.Ship_ID = tblEventList.Ship_ID) INNER JOIN tblEC_Event ON tblEventList.EVENT_ID = tblEC_Event.Event_ID) ON tlkpEventType.EventType_ID = tblEventList.EventType_ID) ON tlkpEventStatus.EventStatus_ID = tblEventList.EventStatus_ID
    GROUP BY tblECs.EC_ID, tblECs.EC_Num, tblECs.EC_Title, tblECs.EC_Rev, tlkpEventType.EventType, tlkpEventStatus.Status, tblShips.ShipName, tblShips.Ship_ID;



    ************************************************** *******************************************


    Private Sub cmdRptEventImpactTDP_Click()



    On Error GoTo cmdqryRptEventImpactTDP_Click_Error





    DoCmd.OpenReport "qryRptEventEC", acViewReport, , "ShipID = " & txtHoldOptionValue, acNormal

    On Error GoTo 0
    Exit Sub


    cmdqryRptEventImpactTDP_Click_Error:


    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdqryRptEventImpactTDP_Click of VBA Document Form_frmMain"


    End Sub

  2. #2
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Hmm, is the option value the Ship ID?

  3. #3
    greatwhite is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2019
    Location
    Ottawa, ON
    Posts
    56


    Woops misspelling of option should have Ship_ID

    Quote Originally Posted by GinaWhipp View Post
    Hmm, is the option value the Ship ID?

  4. #4
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Well, that was an easy fix!

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

Similar Threads

  1. Passing parameter between 2 forms
    By Skarvion in forum Forms
    Replies: 5
    Last Post: 02-05-2016, 11:01 AM
  2. Passing parameter between forms
    By jamedadi in forum Forms
    Replies: 5
    Last Post: 11-11-2013, 02:53 PM
  3. Replies: 1
    Last Post: 01-22-2012, 02:41 PM
  4. Parameter Passing
    By Juan4412 in forum Queries
    Replies: 1
    Last Post: 11-21-2011, 10:23 AM
  5. Passing List of Parameter
    By vignes10 in forum Access
    Replies: 3
    Last Post: 09-15-2011, 07:35 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