Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multi-Use of Report (A2K)

    This is one of those "It would be nice . . " ifs.

    I have the following two routines, both of which use the same Report and work individually.


    Private Sub prv_00450_Click()
    Dim strFunction As String
    Dim strRA As String
    Dim strCombine As String
    strFunction = "F00_Function In (23)"
    strRA = "F01_RA_No In (500, 600)"
    strCombine = strFunction & " AND " & strRA
    On Error GoTo Err_Click
    DoCmd.OpenReport ReportName:="rpt 00450 - Lotto - Ready To Ship", View:=acViewPreview, _
    WhereCondition:=strCombine
    DoCmd.RunCommand acCmdZoom100
    Exit Sub
    Err_Click:
    If Err <> 2501 Then
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

    Private Sub prv_00551_Click()
    Dim strFunction2 As String
    Dim strRA2 As String
    Dim strCombine2 As String
    strFunction2 = "F00_Function In (33)"
    strRA2 = "F01_RA_No In (555)"
    strCombine2 = strFunction2 & " AND " & strRA2
    On Error GoTo Err_Click
    DoCmd.OpenReport ReportName:="rpt 00450 - Lotto - Ready To Ship", View:=acViewPreview, _
    WhereCondition:=strCombine2
    DoCmd.RunCommand acCmdZoom100
    Exit Sub
    Err_Click:
    If Err <> 2501 Then
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

    I tried to get them to work together on one "On Click" button by attempting various combinations, but only the first one would work.

    As always, I'm sure there is a correct combination, but I can't quite get a handle on it.

    Thanks in advance for any help on this. It's not a crucial thing, but just a Would Be Nice Thing,
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Multi-Use of Report (A2K)

    In what sense would you like to combine them? You cannot open the same report twice at the same time with different where-conditions. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multi-Use of Report (A2K)

    Hans,

    I believe you've answered my question with what I thought was most likely, and that is, I can't combine two where conditions.

    Basically, they are two separate sets of criteria, both using the same report format. This was just a case of instead of running the two reports separately, I decided to try and be lazy and bang them both out on one click. I would then use the time saved to . . . blink.
    Cheers,
    Andy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Multi-Use of Report (A2K)

    You could print them one after another at the click of a button, but you're previewing the report. The user has to close the first one anyway (manually) before the second one can be opened so there's hardly anything to be gained by trying to use one click here.

  5. #5
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multi-Use of Report (A2K)

    Hans,

    Totally agree. It was just another of my dubious, mental exercises.
    Cheers,
    Andy

Posting Permissions

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