Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92

    Unanswered: print a report based on a value from option group

    How do I print a report based on a value selected in an option group. I want user to select an option from the option group and then it populates the data on the current record on the form.

    I already have my 5 report set up and 5 queries set up. Each option has a different report. How do I code this?

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    In the option groups OnClick event...

    Select Case Me!optGrpName
    Case 1
    Docmd.Openreport "ReportName1", acViewNormal
    Case 2
    Docmd.Openreport "ReportName2", acViewNormal
    ...
    End Select
    Inspiration Through Fermentation

  3. #3
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    Thanks for that!



    Originally posted by RedNeckGeek
    In the option groups OnClick event...

    Select Case Me!optGrpName
    Case 1
    Docmd.Openreport "ReportName1", acViewNormal
    Case 2
    Docmd.Openreport "ReportName2", acViewNormal
    ...
    End Select

  4. #4
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    In the queries I have parameter that asks the user to enter the client ID.

    Is there any way so that we the user click an option the report is filled with the current record that is open .

    The way I currently have it set up isnt probably the best. At present the user select the option from the group and a parameter pops ups asking the user to enter the Client ID the wish to print. Is the any to get current record to print without having to be prompted by a parameter


    Originally posted by billjov
    Thanks for that!

  5. #5
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    Never Mind I think I many have found a bit of code that will do the trick

    Dim strDocName As String
    Dim strWhere As String
    strDocName = "rptSomeReport"
    strWhere = "[RunID]=" & me!RunID
    DoCmd.OpenReport strDocName, acPreview, , strWhere

Posting Permissions

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