A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can I print report and then delete at the same time?



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2009, 04:27 AM posted to microsoft.public.access.reports
Norm
external usenet poster
 
Posts: 149
Default Can I print report and then delete at the same time?

I want to print the info from a sub report and have the info deleted at the
same time
  #2  
Old December 14th, 2009, 11:56 AM posted to microsoft.public.access.reports
Rob Parker[_3_]
external usenet poster
 
Posts: 173
Default Can I print report and then delete at the same time?

OK. I'll bite on this troll bait ...

Why?

Rob


Norm wrote:
I want to print the info from a sub report and have the info deleted
at the same time



  #3  
Old December 14th, 2009, 01:53 PM posted to microsoft.public.access.reports
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default Can I print report and then delete at the same time?

Define "deleted"...

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Norm" wrote in message
...
I want to print the info from a sub report and have the info deleted at the
same time



  #4  
Old December 14th, 2009, 02:10 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Can I print report and then delete at the same time?

I would not do this. Perhaps you can describe the problem you are trying to
solve by doing this.

You might be able to execute a delete query in the close event of the report,
but if you changed your mind or the printer jammed you would have no way to
try to print the information again.

I would mark the records for deletion (use a boolean field or dateTime field
named DeleteRecord). You could then run a separate process to actually delete
the records once you had successfully printed hardcopy.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
I want to print the info from a sub report and have the info deleted at the
same time

  #5  
Old December 14th, 2009, 03:22 PM posted to microsoft.public.access.reports
Norm
external usenet poster
 
Posts: 149
Default Can I print report and then delete at the same time?

Thanks John,
This is a report that is not big enough to worry about having to re-do, I
have put a control button to delete record and it works fine but only deletes
one line at a time,can i change that control to delete the entire sheet at
once?

"John Spencer" wrote:

I would not do this. Perhaps you can describe the problem you are trying to
solve by doing this.

You might be able to execute a delete query in the close event of the report,
but if you changed your mind or the printer jammed you would have no way to
try to print the information again.

I would mark the records for deletion (use a boolean field or dateTime field
named DeleteRecord). You could then run a separate process to actually delete
the records once you had successfully printed hardcopy.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
I want to print the info from a sub report and have the info deleted at the
same time

.

  #6  
Old December 15th, 2009, 02:19 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Can I print report and then delete at the same time?

If you are using a subform, then the records that are being displayed are
normally filtered by some value (or values) on the main form.

If you can grab that value you should be able to write a delete query that
will delete all the relevant records in the subform.

strSQL = "DELETE FROM [TheSubFormTable] WHERE [TheSubFormTable].[SomeField] "
& TheValueFromTheMainForm

Currentdb().Execute strSQL

I would be sure to backup and test first to make sure this works as expected.

Another alternative would be to build and store a delete query that references
a control on the parent form that has the value. And then execute that stored
query.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
Thanks John,
This is a report that is not big enough to worry about having to re-do, I
have put a control button to delete record and it works fine but only deletes
one line at a time,can i change that control to delete the entire sheet at
once?

"John Spencer" wrote:

I would not do this. Perhaps you can describe the problem you are trying to
solve by doing this.

You might be able to execute a delete query in the close event of the report,
but if you changed your mind or the printer jammed you would have no way to
try to print the information again.

I would mark the records for deletion (use a boolean field or dateTime field
named DeleteRecord). You could then run a separate process to actually delete
the records once you had successfully printed hardcopy.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
I want to print the info from a sub report and have the info deleted at the
same time

.

  #7  
Old December 16th, 2009, 08:38 PM posted to microsoft.public.access.reports
Norm
external usenet poster
 
Posts: 149
Default Can I print report and then delete at the same time?

The query worked Thanks for your help!!

"John Spencer" wrote:

If you are using a subform, then the records that are being displayed are
normally filtered by some value (or values) on the main form.

If you can grab that value you should be able to write a delete query that
will delete all the relevant records in the subform.

strSQL = "DELETE FROM [TheSubFormTable] WHERE [TheSubFormTable].[SomeField] "
& TheValueFromTheMainForm

Currentdb().Execute strSQL

I would be sure to backup and test first to make sure this works as expected.

Another alternative would be to build and store a delete query that references
a control on the parent form that has the value. And then execute that stored
query.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
Thanks John,
This is a report that is not big enough to worry about having to re-do, I
have put a control button to delete record and it works fine but only deletes
one line at a time,can i change that control to delete the entire sheet at
once?

"John Spencer" wrote:

I would not do this. Perhaps you can describe the problem you are trying to
solve by doing this.

You might be able to execute a delete query in the close event of the report,
but if you changed your mind or the printer jammed you would have no way to
try to print the information again.

I would mark the records for deletion (use a boolean field or dateTime field
named DeleteRecord). You could then run a separate process to actually delete
the records once you had successfully printed hardcopy.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Norm wrote:
I want to print the info from a sub report and have the info deleted at the
same time
.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.