• Form rec value to Report

    Author
    Topic
    #472104
    Code:
    How do you pass the current record ID of a record from a form to a report?  
    I can launch the report but the ID value is not correct.  
    Note:  The report's data source is linked to the same table as the form.
    
    Viewing 1 reply thread
    Author
    Replies
    • #1248063

      Dave,

      there are many possible solutions. Probably the simplest is to pass the ID as part of a Where parameter. If you look at the options for Docmd.OpenReport, you will see one is a WhereCondition. Fill this with a string such as “[ID]=29”, and it should work.

      Regards,

      Jules

    • #1248064

      Alright, thats working. It turns out I had reset the query and report datasource.
      Now, how do I pass the value of the current record (on the form) to that ID value?

      ahhh….”ID = ” + Str(MyID)

      Thanks Jules!!

    Viewing 1 reply thread
    Reply To: Reply #1248063 in Form rec value to Report

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel