Report and Requery

Experts,

I have a report that has hyperlinks.
I click one and it goes to another form.
The report does not close out
When I close the form I want the report to requery or refresh or not sure what it is but what I want to happen is the data to update.

Any ideas?

What I have is below:

Private Sub Report_Activate()

    'Me.Requery
    'dont think refresh is avail in reports
   
End Sub

Private Sub Report_Current()

'Me.Requery
'does not work...endless loop

End Sub
pdvsaProject financeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Requery does not apply to Reports.  It is not a method of the report object.

mx
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Also, there is no Current event in a Report.

mx
0
DoveTailsCommented:
Could you close the report when you open the form and then add

DoCmd.OpenReport myReportName, acPreview      to a close button on the form so report opens back up (which should reflect the 'new' data)     ?

just a thought.........good luck.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dale FyeCommented:
>>I  have a report that has hyperlinks.  I click one and it goes to another form.

Do you mean it goes to another report, or do you mean that a form has hyperlinks, that open other forms when clicked?  Please clarify.

0
peter57rCommented:
Sorry mx-- time moves on for us all.
Reports have all these events now.

However, if the poster wants to change the report contents based on changes he has made in the form then I would have thought the easiest route is to close and then re-open the report.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Yes ... as soon as I posted that, I recalled that his db is A2010!

mx
0
Dale FyeCommented:
Joe,

I was going to recommend the same thing (close and reopen), or possibly resetting the RecordSource for the report.

How would you have know that he was using 2010 from the OP, or is that just from previous work with pdvsa?  

I don't have 2010 and have not needed to use this functionality in 2007.  Can you click on hyperlinks in a report in Preview mode, or do you have to open it in acViewReport mode for hyperlinks (or other controls) embedded in the report to work?
0
Rey Obrero (Capricorn1)Commented:
<When I close the form I want the report to requery>

try placing this codes in the close or unload event of the form

reports("nameofreport").recordsource=reports("nameofreport").recordsource

see if the codes updates the report..
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"or is that just from previous work with pdvsa?  "
Yes.  He has uploaded db's several times.

mx
0
pdvsaProject financeAuthor Commented:
Ok i might have to close and reopen.
Cap: i will try that

I know there is a crafty way todo this as i dl a template and the reportupdates automatically without any code.  I assume the report updates through use of a tag property as that was the only metbod icould see.
0
Jeffrey CoachmanMIS LiasonCommented:
fyed.

Yes, you must be in Report View to have "Interactivity" with the report
(Activate Hyperlinks, Filter, Refresh, ...etc)
0
Dale FyeCommented:
Jeff/Joe/anyone else who cares to chime in,

Have you had much need for this drill-down functionality?  I can see where it might be useful to provide a drill-down functionality within a series of reports (similar to many of the BI packages).  But I have not had a chance to play with it at all, and have not had any clients that needed that functionality (although I do have one now that might be able to use this to drill down on his data).

Any of ya'll have a database sample that implements this type of drill-down functionality using the Report View?
0
Jeffrey CoachmanMIS LiasonCommented:
pdvsa,

This is why I prefer to open Reports/Forms via standard code and not by hyperlinks.

With Hyperlinks you can only navigate to the Object.
With code you have many more Option
(Open Args, Error handling, ...etc)

hyperlinks are great, because they require no code (and hence are "Light Weight")
0
Dale FyeCommented:
pdvsa,

If you are in fact opening another form from the hyperlink, and making changes (additions, changes, deletions) from that form, then you might be able to use the close event of that form to check and see whether the report is open, and if so, reset the RecordSource of the report, somethin like:

Private Sub Form_Close

    if currentproject.AllReports("reportname").isloaded then
        Reports("reportName").Recordsource = Reports("reportName").RecordSource
    End If

End Sub
0
pdvsaProject financeAuthor Commented:
Cap:  it did not seem to refresh the report.   I can hit F5 and it does refresh.  

I will revert to closing and reopening the report.  Seems like the best solution for now.  

I looked at the form that has the Tag property of "EditDetails" and really dont know what it means.
this is where the template resides:  http://office.microsoft.com/en-us/templates/CT010142824.aspx#ai:TC001225356|
if anyone cares to look.  It is the Task Details form (I think).  

0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"Have you had much need for this drill-down functionality? "
Ahh ... not sure what you are referring to Dale?

mx
0
Dale FyeCommented:
Joe,

Disregard.  I'll do some research and pose a separate question on this topic, maybe on the Experts Discussion Thread.
0
Jeffrey CoachmanMIS LiasonCommented:
Dale,
OK, great
just remember to post the link here

Jeff
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
pdvsa:
The statement I made in the Accepted answer was incorrect for A2007/10.  So, you really should not accept that answer ...

mx
0
pdvsaProject financeAuthor Commented:
Mx: thanks fr pointing thAt out.   I will reopen. I should have awarded pts to Dovetails.  Even though you wont get pts you get pts for pointing that out.   Have a great weekend!
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
np
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.