Multiple filter Report (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:00
Joined
May 21, 2018
Messages
8,463
No. Can you post your DB? It will be a lot faster.
 

hfsitumo2001

Member
Local time
Today, 07:00
Joined
Jan 17, 2021
Messages
365
if dates are missing, you add Nz() to each textbox (date).
also you need to make sure that Combo_User is not blank:
Code:
Private Sub OpenSelectedUsagerpt_Click()
If Me![Combo_User].ListIndex > -1 Then
    With DoCmd
        .SetParameter "cb1", Me![Combo_User]
        .SetParameter "dt1", "#" & Format$(Nz(Me![txtstDate], #1/1/1899#), "mm\/dd\/yyyy") & "#"
        .SetParameter "dt2", "#" & Format$(Nz(Me![txtEndate], #1/1/9999#), "mm\/dd\/yyyy") & "#"
        .OpenReport "SuppliesUsagebyDepartment_Users_MultiSelectTest", acViewPreview
    End With
Else
    Msgbox "Please select a user from the list."
End If
End Sub

also how did you Instantiate the ClassAutoCompleteCombo.
can you show me that Load/Open event of your form.
Nothing any even, Arnel. What we have on even property of the form is only Timer interval 0 and key preview " No".

Moreover it seems it shows something report with content, then very quickly fired by the empty record report
 

hfsitumo2001

Member
Local time
Today, 07:00
Joined
Jan 17, 2021
Messages
365
No. Can you post your DB? It will be a lot faster.
The database is already big with confidential ones, so I do not know which one to trim.
 

hfsitumo2001

Member
Local time
Today, 07:00
Joined
Jan 17, 2021
Messages
365
if dates are missing, you add Nz() to each textbox (date).
also you need to make sure that Combo_User is not blank:
Code:
Private Sub OpenSelectedUsagerpt_Click()
If Me![Combo_User].ListIndex > -1 Then
    With DoCmd
        .SetParameter "cb1", Me![Combo_User]
        .SetParameter "dt1", "#" & Format$(Nz(Me![txtstDate], #1/1/1899#), "mm\/dd\/yyyy") & "#"
        .SetParameter "dt2", "#" & Format$(Nz(Me![txtEndate], #1/1/9999#), "mm\/dd\/yyyy") & "#"
        .OpenReport "SuppliesUsagebyDepartment_Users_MultiSelectTest", acViewPreview
    End With
Else
    Msgbox "Please select a user from the list."
End If
End Sub

also how did you Instantiate the ClassAutoCompleteCombo.
can you show me that Load/Open event of your form.
I initiated autocomplete combo, by using wizard, may be the one is actually field is not the name of Library but ID?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:00
Joined
May 7, 2009
Messages
19,175
show the Record source of the combo.
 

hfsitumo2001

Member
Local time
Today, 07:00
Joined
Jan 17, 2021
Messages
365
if dates are missing, you add Nz() to each textbox (date).
also you need to make sure that Combo_User is not blank:
Code:
Private Sub OpenSelectedUsagerpt_Click()
If Me![Combo_User].ListIndex > -1 Then
    With DoCmd
        .SetParameter "cb1", Me![Combo_User]
        .SetParameter "dt1", "#" & Format$(Nz(Me![txtstDate], #1/1/1899#), "mm\/dd\/yyyy") & "#"
        .SetParameter "dt2", "#" & Format$(Nz(Me![txtEndate], #1/1/9999#), "mm\/dd\/yyyy") & "#"
        .OpenReport "SuppliesUsagebyDepartment_Users_MultiSelectTest", acViewPreview
    End With
Else
    Msgbox "Please select a user from the list."
End If
End Sub

also how did you Instantiate the ClassAutoCompleteCombo.
can you show me that Load/Open event of your form.
Or maybe because the 2nd button in the form which is to run report with all record is using Macro?
 

hfsitumo2001

Member
Local time
Today, 07:00
Joined
Jan 17, 2021
Messages
365
No. Can you post your DB? It will be a lot faster.
Thank you very much MajP, you helped me a lot in open my mind to understand more the mechanism of the MS Access program/vba. Fifnally it works when I put the filter parameter under CustomerID, not under customer name. I know this by the help of Mr. Gasman on the Utter Access Forum. Thank you.
 

Users who are viewing this thread

Top Bottom