Report is not updating

VorLag

Board Regular
Joined
May 13, 2013
Messages
205
I am trying to get Access set up so that a user can submit a form to update a table. A report is connected to that table. When the user clicks on the submit button, it calls a macro that saves the report as a PDF and emails it. I want the report to only show the last record and not all records. The easiest way I found to do that was to put the report fields in the footer and to have it set to display records in descending order on the primary key.

The problem I'm having is that when I open the report in Report View, it looks fine. When I click on the Submit button, the PDF is showing the 2nd record, not the last record. I tried adding to the macro to have it open the report and then save and close it, but it's still saving the PDF on the 2nd record and I have no idea where that's coming from and why it's doing that.

Can someone please tell me how to fix this so that the PDF is displaying what the report is currently set to display? I can't figure why it's doing this.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
you need to open the report with the key , or some ID to the EXACT record you want. the '2nd record' means nothing.
Your form should have the 'criteria' on it so the report query pulls the exact record

DoCmd.SendObject acSendReport, vRpt, acFormatPDF, vTo, , , vSubj, vBody
or
DoCmd.OpenReport rptRptName, , , "[ClientID]=" & Me!clientID
 
Upvote 0
That's the thing, I don't want it to open or save a PDF on the 2nd record. It doesn't open on the 2nd record. It opens on the last record, but it's saving the PDF on the 2nd record and I have no idea why it's doing that. I just want the PDF to save on the record that the report opens to.
 
Upvote 0

Forum statistics

Threads
1,221,860
Messages
6,162,479
Members
451,769
Latest member
adyapratama

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top