DoCmd.OpenReport

ccordner

Active Member
Joined
Apr 28, 2010
Messages
355
I have an operation which opens an access report for a specific date:

Code:
With objaccess    
    .AutomationSecurity = msoAutomationSecurityLow
    .Visible = False
    .OpenCurrentDatabase "\\bdifps01\Groups\Platform.Supervisor\DO NOT USE - Log (Front).accdb"
    .DoCmd.OpenReport "rptSupervisorsLogHistoric", acViewPreview, , "([DateReported]=#" & Format(dtpReportDate.Value, "mm/dd/yy") & "# And [TimeReported]>=TimeSerial(4,0,0) ) Or ([DateReported]=#" & Format(dtpReportDate.Value + 1, "mm/dd/yy") & "# And [TimeReported]<TimeSerial(4,0,0) )", acHidden
    .DoCmd.OutputTo acOutputReport, "rptSupervisorsLogHistoric", acFormatPDF, Folder & "\BDI Supervisors Log for " & Format(dtpReportDate.Value, "d mmm yy") & ", Created at " & Format(Time, "hhmm") & " on " & Format(Date, "d mmm yy") & ".pdf", , False
    .DoCmd.Close acReport, "rptQuote"
    .CloseCurrentDatabase


End With

What I need to do is convert it so that it finds all results where a search string appears in the comment field. But also, I want the report to say something like 'Search Results for "searchstring"' or something like that.

Is this possible?

Thanks
Chris
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,219
Messages
6,123,691
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top