How to print all the records after each working day (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
can you show a snapshot of form frmPrintFilter.
 

113hans

Member
Local time
Today, 22:56
Joined
Mar 31, 2021
Messages
47
Is it what you mean
1.PNG




2.PNG



1704420034868.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
try this, select a date to print and it will show the WhereCondition on the screen (but will not print). Capture the Message window and post it here for us to see.
 

Attachments

  • samplePrintSelectedRecord2.accdb
    1.6 MB · Views: 35

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
what country do you reside, i will try to use same date regional setting to test.
 

113hans

Member
Local time
Today, 22:56
Joined
Mar 31, 2021
Messages
47
I'm from Vietnam, have you ever heard about my country, just a small one 😅
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
try again, and post if the dot(.) has changed to slash(/).

BTW, i did not change my region. I don't want to mess things, you know.
 

Attachments

  • samplePrintSelectedRecord2.accdb
    1.6 MB · Views: 49

113hans

Member
Local time
Today, 22:56
Joined
Mar 31, 2021
Messages
47
Anything convenient for you, I'll follow. Here the dot(.) has changed to the slash(/)
11.PNG


12.PNG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:56
Joined
May 7, 2009
Messages
19,245
Ok, I think you are OK now.
Open from frmPrintFilter in Design view and Modify the Click Event of the Print button.
Change it to:
Code:
Private Sub cmdPrint_Click()
Dim sWhere As String
sWhere = IIf(Me.lstDayToPrint <> "All", "TransDate=#" & Me.lstDayToPrint & "#", "(1=1)")
sWhere = Replace$(sWhere, ".", "/")
'MsgBox "WhereCondition: " & sWhere
'Exit Sub
Me.Visible = False
DoCmd.OpenReport _
        reportName:="Report1", _
        View:=acViewPreview, _
        WhereCondition:=sWhere
End Sub
 

113hans

Member
Local time
Today, 22:56
Joined
Mar 31, 2021
Messages
47
Yeah, everything is OK now.
Having helped me to solve the problem from the beginning till the end,
thanks for your patience of a saint @arnelgp 😇
 

Users who are viewing this thread

Top Bottom