[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

Refresh report access 2007

I have a report in access 2007.  It has job numbers grouped by assembly dates.  

I have the report set up to where I can double click on the job number to bring up a form where the assembly date can be changed.  After I save/close the form I have to hit the Refresh All button above the report to have the job show up under the new date.

Is there a way to have the report refresh using code after closing the form?  If I am in the middle of the report and I select the refresh button the report is updated and the view stays the same (does not go back to the top of the report).  I am worried that if I do close/open report by code on the form closing event it will open the report at the top and not section I was working at.

I can live with hitting the refresh button - but thought I would see if this could be done with code.

Any suggestions?

Thanks,
0
johnmadigan
Asked:
johnmadigan
  • 4
  • 2
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
<I have a report in access 2007> are you sure it is a report?

i believe you are referring to a form.
0
 
csmart2301Commented:
put this code on the OnActivate of the report you want to refresh

Private Sub Report_Activate()
     Me.Requery
End Sub
0
 
csmart2301Commented:
no he can open a form from a report by placing a dblclick macro on the field in the report that he wishes to bring up an edit form then use a where condition such as this one i used

[Reports]![PMP Pipeline 2]![Customer Name:]=[Customer Name:] And [Reports]![PMP Pipeline 2]![Bid Number:]=[Bid Id]

pmp bid form loads i edit the info close the form and the report is updated.

fyi
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
johnmadiganAuthor Commented:
Yes it is a report - in access 2007 reports I am able to set up a double click event the job number feild - when I double click the text and it will open up a form.

I tried:
Private Sub Report_Activate()
Me.Requery
End Sub

The report did not refresh.  I tried On Got Fucus but this didn't work - I still have to click the Refresh button.
0
 
Rey Obrero (Capricorn1)Commented:
don't have A2007 right now, so i can't post anything for the meantime.

csmart2301 can help you
0
 
csmart2301Commented:
is the editing form remaining open if so make sure that the edit record no longer has the focus or close the editing form
0
 
csmart2301Commented:
also place a form requery on the close or lost focus event of the editing form
0
 
johnmadiganAuthor Commented:
I got it to work by using the onclose event of the form:

Private Sub Form_Close()
Reports![rptFrCap].Requery
End Sub

I also did not have the correct syntex for calling the report.

It works great. Thanks for the assist.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now