Re: Wrong "Record ID"?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Marsh,
I can't "nail it down" to a point of re-producing at will.

The normal end user process is to create the report.
Then, while the report is in preview, he/she presses
the "Print Screen" to capture the report as a picture
and switch to a image editor to manipulate and save
the results. It's after that that the report is "X'd".

A couple of time, my driving form's code sheet reported
that the report was "loaded" when the report path was
again taken.

I can't imagine how task switching would confuse Access?

Thanks,
Bill



"Bill" <billstanton@xxxxxxxx> wrote in message
news:bJednTTOm6_rJCfVnZ2dnUVZ_q7inZ2d@xxxxxxxxxxxxxxx
I'll play with this some more with some added code to
check "IsLoaded" and see if I can't narrow down the
sequence of user operations whereby I can re-produce
the problem at will.

I'll not likely get to this until later today.

Thanks Marsh,
Bill

"Marshall Barton" <marshbarton@xxxxxxxxxx> wrote in message
news:ai8lb4h9fpssv4o32nctobc76a3hgeh3ev@xxxxxxxxxx
You can use CurrentProject.AllReports!myreport.IsLoaded to
check if a report is open.

If you do exit out of the report before selecting a
different record, then I guess you could have a timing issue
even if I've never seen it. For this scenario, opening the
report in dialog mode might(?) change the timing.

The alternative I was thinking of is to check if the report
is already open and, if not, opening it. If it is open,
just set the report's Filter property. (Note: this concept
is based on the fact that setting an open report's Filter or
OrderBy property (re)initates the report's Open event.)
This would probably be more efficient, but the UI might be
more confusing if you can not see the form behind the
report.
--
Marsh
MVP [MS Access]



Bill wrote:
I "X" out of the report and there's no way to predict
if another selection is forthcoming, so perhaps I need
to test to see if it's closed and wait until it does? That
sounds like a great way to loop in wait forever?

Since I suspect there's a timing issue here, It doesn't
seem that changing the filter will do the job if the report
is in the process of closing? Unless changing the filter
effectively cancels the close? If that's the case, then
I'd simply change the filter if I find the report open.

What's the method to test for report open? Something
like Me.Reports(reportname) = true?

"Marshall Barton" wrote
Bill wrote:

I have a situation that is more of a nuisance than
a problem per se'.

I have an application wherein a record is selected
via a "right-click" in the "Record Selector" area of
a form. The right-click menu invokes a function in
the code sheet of the form that in turn issues a
DoCmd.OpenReport passing the RecordID
(Me.WorkID) of the record corresponding to
the "Record Selector".

The report previews the particulars of what is
contained in that record.

Now, not always but more often than not, if I then
right-click on another record I get the same report
again. When I then close the preview and re-select
the same record with the right-click, I get the
correct report content.

Symptomatically, it appears that the RecordID does
not always get updated to the current record as fast
as the report is executed by the right-click function,
which doesn't make sense to me, but again, that's
the symptomatic behavior.

That would be the expected(?) behavior if the report's
preview was not closed before you selected a different
record.

It is possible to check if the report is already open and to
then change its Filter property instead of trying to open ab
alredy open report.




.



Relevant Pages

  • Re: Filter for Report not working?????
    ... Do I need to release the filter or close the TableFame? ... contFilter DynArrayString ... Your first example based on ContractNo ... I decided to go with a table in PRIV for the report. ...
    (comp.databases.paradox)
  • Re: Show all records through combo box
    ... I should not have used the term report to describe what it is I ... was refering to is a MCReport. ... the subforms to the main form using the Company_ID and the MCReport_ID. ... There is no code in the filter section. ...
    (microsoft.public.access.forms)
  • Re: Show all records through combo box
    ... provided by an assortment of suppliers. ... If this basic model sounds like it would work, the report can be devised. ... the filter remains disabled. ... all of the other subforms change according to the MCReport selected ...
    (microsoft.public.access.forms)
  • Re: Filter for Report not working?????
    ... then when the form opens the proper records are NOW displayed for data ... Do I need to release the filter or close the TableFame? ... contFilter DynArrayString ... I decided to go with a table in PRIV for the report. ...
    (comp.databases.paradox)
  • Re: Show all records through combo box
    ... Each report deals with a different system in the car. ... For instance, what is an MCReport? ... because the filter button on the toolbar is disabled. ... the subforms to the main form using the Company_ID and the MCReport_ID. ...
    (microsoft.public.access.forms)