Full Version: Form...not updating with report.
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
brycole
Ok, so i have a main form with all the info on it. I have a button that opens a report. It works perfectly.

Except when I go to NEW record. I create a new record I type all my stuff in. And i click on the button to open the report. The report open blanks. I have to close the form and reopen the form and go to that record then click the print button for it to show up.

This is killing me, anyone have any ideas?

-Bryan
HiTechCoach
I see this a lot.

You mist save the reord before running the report!

Before the openreport add a line of code to save the record.

TIP: use the command button wizard to create a save record button to see what the code will look like to save a record.
brycole
I tried

Me.requery....is that not saving it ?tongue.gif
HiTechCoach
Requery doe not save the record.
HiTechCoach
Since I have to save a record so much, I have created a SUB that is called SaveRecord that does this so that I just have to all one a line of code to call the SUB any time I need it.
jmcwk
Try refresh with a command button



Private Sub Command358_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_Refresh_Form_Click:
Exit Sub

Err_Refresh_Form_Click:
MsgBox Err.Description
Resume Exit_Refresh_Form_Click
End Sub
brycole
Arg. I'm ready to go home. Lol


Private Sub Print_Report_Click()
On Error GoTo ErrorHandle

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenReport "rptMainSitePrint", acPreview, , "[ProgramID] = " & Me.ProgramID
DoCmd.OpenForm "frmSign", acNormal, , "[ProgramID] = " & Me.ProgramID
End
ErrorHandle:
Select Case Err



Got that [censored] working now!! frown.gif Thanks a ton.

-Bryan
HiTechCoach
John, refresh is not the answer. The record needs to be saved or the report can not read the data since the data is still in the recordset "buffer" in the form.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.