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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View Report OR Datasheet

Status
Not open for further replies.

wayneryeven

Technical User
May 21, 2004
101
GB
Hey guys
I have a reports form that allows users to select the type of report they want (based on cascading combo's) and they can then turn other filters on/off. When complete they click CREATE- this looks up the report they have selected and presents as print preview.

Now what i want is to include and option to 'View as datasheet' thus allowing them to copy/paste data into an .XLS if required. Whats my best way of doing this?

At the mo i have a table detailing all my reports, their categories and sub categories and sort order ID etc. I cant open a form based on their choice, hence i thought i could open the query behind the report itself in Datasheet view?

Thus if i created a new field in the Reports table and added the query behind it, then give the user an option to select Report or Datasheet, this in turn will run an IF statement and either show the report or run the query to screen?

I'm just interested to hear everyones thoughts on how best to achieve this?

Thanks to all for your time and suggestions.
 
The datasheet would probably come from the report's record source property.
You could try open the report hidden in design view and store the record source in a memory variable. Then set the SQL property of a saved query to the value of the memory variable. Finally you would display the saved query as a subform in a main form.

Here is a demo of how to use the query as a subform

Duane
Hook'D on Access
MS Access MVP
 
There are several ways to display the data. What ever works for you is good.

My only comment, make sure that your user can not edit any displayed data fields.

Also make sure that the user can not add or delete records in the display.

The last thing you want to happen is someone accidently changing or deleting something when all they were trying to do was print a report.

Hope This Helps,
Hap...

Access Developer [pc] Access based Accounting Solutions - with free source code
Access Consultants forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top