Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save as report

Status
Not open for further replies.

rrhandle

Programmer
Dec 26, 2001
193
US
I have a piece of VBA code that loops through the database, finds the information it is looking for, then saves the search results to a text file named C:\Search.txt.

My question: Is it possible to have this text saved as a report, and have the report automatically open?

Thanks

--Rob

 
Yes.

Format [tt]Search.txt[/tt] in a standard format (like CSV), create a linked table that points to [tt]Search.txt[/tt], build a report based on the linked table, use the [tt]OutputTo()[/tt] method to generate a file (Sanpshot format), use the [tt]CreateObject()[/tt] to spawn an instance of the newly created and saved report?



 
Link to your .txt file using File, Get External Data, Link Tables and create a report from it.

Create a new blank form in Access, and open it in design view. Select the toolbox on the Tools menu and drop a command button on your form, following the wizard for "Report Operations". That will give you the code to open a report from a command button.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top