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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|