Quote:
Originally Posted by Bad Horsey
Windows XP
MS Access 2000
Hello folks. First timer here. Have a problem with a form.
I am trying to open a report using a button on a form. The report will use information from a table which is particular to the record being viewed on the form at the time. I want to include any data that the user has input into the form directly before clicking the button. For this reason, I am using the requery function in the macro before opening the report. The trouble is, that this sends the form back to record no. 1.
This is part of a wider problem for me. It is essential on this form that all information and all coded calculations are completed before various reports are opened. I have even included a 'Calculate' button on the form to re-run any code and ensure that all data is current before reports are generated. The trouble is that the user has to remember to click this before printing anything.
I have been trying to get around the problem with non-record specific reports by closing the form and opening it again via macro. This is not a very classy way of doing things, but I'm a bit stuck. I suppose the short summary is: Is there a way of updating the table data from a form(just like you do when you move from one record to another) directly before generating a report and without changing the record in view?
Try using
IF me.dirty = true then
me.dirty = false
end if
it commits the record you're on.