Printing under various Wins and r/t

  • Thread starter Thread starter pvp too
  • Start date Start date
P

pvp too

This will sound vague but I cannot get to the bottom of
this. MS support technical d/b does not give useful
answers and newsgroups do not seem to explain the message
in a way that fits the facts as known.

I have a prog in Access 2000 runtimed by Access 2002 Dev.
There is very simple print code in this prog. Printing
reports works a treat under Windows XP under Access.
Under Windows ME and Wiundows 98 runtime, IT fails,
usually giving a message along the lines of

"you cancelled the previous operation"

Has anyone else come across this? This is urgent - we are
releasing this thing next Monday...

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!

Many thanks.
 
There are *many* causes for this particular error. Basically, it is saying,
"I can't do what you asked for, because I have to do something else first
and I can't do that at present." Of course, the "something else" can be
anything! Here are some examples:

1. Events
What events may need to run before Access can run the report? For example,
the BeforeUpdate or LostFocus of a text box, the BeforeUpdate or AfterInsert
of a Form. You can avoid these issues by explicitly saving:
If Me.Dirty Then
Me.Dirty = False
End If
The code doesn't prevent the issue, but it does move you closer to
identifying the issue.

2. Bad filter
If you misspell a field name in a Filter or the WhereCondition of the
report, Access allows you to assign the Filter property, but it then fails
when you try to set the FilterOn to true. The message then indicates that
the previous operation (i.e. setting the Filter property) failed when the
FilterOn was attempted. This is a common issue, e.g. it also happens in
DLookup().

3. Name AutoCorrect off?
Tied to number 2, if you have not unchecked the boxes under Tools | Options
| General | Name AutoCorrect, Access may attempt to track changes to the
field names, and so you can receive the error even if you are using the
right names. For more information on this issue, see:
http://allenbrowne.com/bug-03.html

4. Unclosed objects
You can also receive the error if you have previously opened something
(form, recordset, ...) and failed to close it, or Set an object variable and
failed to dereference it by explicitly setting it to Nothing before exising
the routine where the object was declared, or by using public variables that
remain set and cause concurrency issues. Since another process is current,
the current process cannot proceed.

5. Service patches
There were bugs in JET that caused the error. When you create the runtime,
it does not automatically apply the latest patches, so you need to
explicitly run the patch for Access runtime 2002 and also for JET 4 on all t
he workstations. Expecially Jet 4! See:
http://support.microsoft.com/support/servicepacks

6. Separate runtimes
The runtimes generally include the system DLLs. Win 98/ME use different
system files than Win 2000/XP. You will probably need to install the runtime
packaging wizard on a Win98 machine, and create a separate release of the
software for Win98 than for WinXP.

If that does not solve the issue, someone may have a clue in the newsgroup:
microsoft.public.access.developers.toolkitode
 
That was really comprehensive and some of the points you
make are possibilities. I am following them up.
I am going to tookits ODE also, as you suggested.
 
Another thought has occured to me. May I give you a more
detailed view of how I am doing the printing?
[assume yes]
I have a form where I select some criteria and then open
a report based on a query that uses thecriteria I entered
on the form "docmd.openreport, ..., acPreview". I also
have a toolbar pop up when the report is displayed in
preview that contains a print button that links to the
following code:

"
Function toolbarprint(thisReport As String)
On Error GoTo Err_Command1_Click

Dim stDocName

stDocName = thisReport
DoCmd.OpenReport stDocName, acViewNormal

Exit_Command1_Click:
Exit Function

Err_Command1_Click:
MsgBox Err.description
Resume Exit_Command1_Click

End Function

"
The thought occurs to me that I may ned to close the
previewed report before I open it for printing? Or maybe
I need to close both afterwards. Or both. Clutching at
straws here!
I would be grateful for any comments you have, however
rude.
[assume no]
Thanks anyway...
-----Original Message-----
That was really comprehensive and some of the points you
make are possibilities. I am following them up.
I am going to tookits ODE also, as you suggested.
-----Original Message-----
There are *many* causes for this particular error. Basically, it is saying,
"I can't do what you asked for, because I have to do something else first
and I can't do that at present." Of course, the "something else" can be
anything! Here are some examples:

1. Events
What events may need to run before Access can run the report? For example,
the BeforeUpdate or LostFocus of a text box, the BeforeUpdate or AfterInsert
of a Form. You can avoid these issues by explicitly saving:
If Me.Dirty Then
Me.Dirty = False
End If
The code doesn't prevent the issue, but it does move
you
closer to
identifying the issue.

2. Bad filter
If you misspell a field name in a Filter or the WhereCondition of the
report, Access allows you to assign the Filter
property,
but it then fails
when you try to set the FilterOn to true. The message then indicates that
the previous operation (i.e. setting the Filter property) failed when the
FilterOn was attempted. This is a common issue, e.g. it also happens in
DLookup().

3. Name AutoCorrect off?
Tied to number 2, if you have not unchecked the boxes under Tools | Options
| General | Name AutoCorrect, Access may attempt to track changes to the
field names, and so you can receive the error even if you are using the
right names. For more information on this issue, see:
http://allenbrowne.com/bug-03.html

4. Unclosed objects
You can also receive the error if you have previously opened something
(form, recordset, ...) and failed to close it, or Set
an
object variable and
failed to dereference it by explicitly setting it to Nothing before exising
the routine where the object was declared, or by using public variables that
remain set and cause concurrency issues. Since another process is current,
the current process cannot proceed.

5. Service patches
There were bugs in JET that caused the error. When you create the runtime,
it does not automatically apply the latest patches, so you need to
explicitly run the patch for Access runtime 2002 and also for JET 4 on all t
he workstations. Expecially Jet 4! See:
http://support.microsoft.com/support/servicepacks

6. Separate runtimes
The runtimes generally include the system DLLs. Win 98/ME use different
system files than Win 2000/XP. You will probably need
to
install the runtime
 
Interesting. Your code is opening another instance of the report. It would
make sense to close the current instance first.

For a custom toolbar to use in report preview, why not copy the Print button
from the regular report view toolbar?

1. Right-click the area beside your toolbars, and choose Customize.
2. Display both your custom toolbar and the Print Preview toolbar.
3. Ctrl+drag the Print button from Print Preview to your custom toolbar.

Be sure to Ctrl+drag to make a copy of the button; otherwise you are moving
it.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

pvp too said:
Another thought has occured to me. May I give you a more
detailed view of how I am doing the printing?
[assume yes]
I have a form where I select some criteria and then open
a report based on a query that uses thecriteria I entered
on the form "docmd.openreport, ..., acPreview". I also
have a toolbar pop up when the report is displayed in
preview that contains a print button that links to the
following code:

"
Function toolbarprint(thisReport As String)
On Error GoTo Err_Command1_Click

Dim stDocName

stDocName = thisReport
DoCmd.OpenReport stDocName, acViewNormal

Exit_Command1_Click:
Exit Function

Err_Command1_Click:
MsgBox Err.description
Resume Exit_Command1_Click

End Function

"
The thought occurs to me that I may ned to close the
previewed report before I open it for printing? Or maybe
I need to close both afterwards. Or both. Clutching at
straws here!
I would be grateful for any comments you have, however
rude.
[assume no]
Thanks anyway...
 
That cracked it, Mr Browne! Undyiung gratitude is yours...
Why write code when that nice Mr Gates already has?
peter
-----Original Message-----
Interesting. Your code is opening another instance of the report. It would
make sense to close the current instance first.

For a custom toolbar to use in report preview, why not copy the Print button
from the regular report view toolbar?

1. Right-click the area beside your toolbars, and choose Customize.
2. Display both your custom toolbar and the Print Preview toolbar.
3. Ctrl+drag the Print button from Print Preview to your custom toolbar.

Be sure to Ctrl+drag to make a copy of the button; otherwise you are moving
it.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Another thought has occured to me. May I give you a more
detailed view of how I am doing the printing?
[assume yes]
I have a form where I select some criteria and then open
a report based on a query that uses thecriteria I entered
on the form "docmd.openreport, ..., acPreview". I also
have a toolbar pop up when the report is displayed in
preview that contains a print button that links to the
following code:

"
Function toolbarprint(thisReport As String)
On Error GoTo Err_Command1_Click

Dim stDocName

stDocName = thisReport
DoCmd.OpenReport stDocName, acViewNormal

Exit_Command1_Click:
Exit Function

Err_Command1_Click:
MsgBox Err.description
Resume Exit_Command1_Click

End Function

"
The thought occurs to me that I may ned to close the
previewed report before I open it for printing? Or maybe
I need to close both afterwards. Or both. Clutching at
straws here!
I would be grateful for any comments you have, however
rude.
[assume no]
Thanks anyway...
-----Original Message-----
That was really comprehensive and some of the points you
make are possibilities. I am following them up.
I am going to tookits ODE also, as you suggested.
-----Original Message-----
There are *many* causes for this particular error.
Basically, it is saying,
"I can't do what you asked for, because I have to do
something else first
and I can't do that at present." Of course,
the "something else" can be
anything! Here are some examples:

1. Events
What events may need to run before Access can run the
report? For example,
the BeforeUpdate or LostFocus of a text box, the
BeforeUpdate or AfterInsert
of a Form. You can avoid these issues by explicitly
saving:
If Me.Dirty Then
Me.Dirty = False
End If
The code doesn't prevent the issue, but it does move you
closer to
identifying the issue.

2. Bad filter
If you misspell a field name in a Filter or the
WhereCondition of the
report, Access allows you to assign the Filter property,
but it then fails
when you try to set the FilterOn to true. The message
then indicates that
the previous operation (i.e. setting the Filter
property) failed when the
FilterOn was attempted. This is a common issue, e.g. it
also happens in
DLookup().

3. Name AutoCorrect off?
Tied to number 2, if you have not unchecked the boxes
under Tools | Options
| General | Name AutoCorrect, Access may attempt to
track changes to the
field names, and so you can receive the error even if
you are using the
right names. For more information on this issue, see:
http://allenbrowne.com/bug-03.html

4. Unclosed objects
You can also receive the error if you have previously
opened something
(form, recordset, ...) and failed to close it, or Set an
object variable and
failed to dereference it by explicitly setting it to
Nothing before exising
the routine where the object was declared, or by using
public variables that
remain set and cause concurrency issues. Since another
process is current,
the current process cannot proceed.

5. Service patches
There were bugs in JET that caused the error. When you
create the runtime,
it does not automatically apply the latest patches, so
you need to
explicitly run the patch for Access runtime 2002 and
also for JET 4 on all t
he workstations. Expecially Jet 4! See:
http://support.microsoft.com/support/servicepacks

6. Separate runtimes
The runtimes generally include the system DLLs. Win
98/ME use different
system files than Win 2000/XP. You will probably need to
install the runtime
packaging wizard on a Win98 machine, and create a
separate release of the
software for Win98 than for WinXP.

If that does not solve the issue, someone may have a
clue in the newsgroup:
microsoft.public.access.developers.toolkitode

message
This will sound vague but I cannot get to the
bottom
of
this. MS support technical d/b does not give useful
answers and newsgroups do not seem to explain the
message
in a way that fits the facts as known.

I have a prog in Access 2000 runtimed by Access 2002
Dev.
There is very simple print code in this prog. Printing
reports works a treat under Windows XP under Access.
Under Windows ME and Wiundows 98 runtime, IT fails,
usually giving a message along the lines of

"you cancelled the previous operation"

Has anyone else come across this? This is urgent - we
are
releasing this thing next Monday...

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!

Many thanks.


.
 
Back
Top