Event error - pls help.

C

Catalin

Dear friends,

I am confronting with an error and I do not know why it appears and how I
can get rid of it.

The error comes when I write a code in ANY of the event methods of the
report - On Activate, On Open etc.

The error message is: "The expression On Activate you entered as the event
property setting produced the following error: A problem occured while Access
was communicating with the OLE server or Activex control"

On Activate is replaced with On Open if I use this event. Now even if I
delete the code, the error still persists and I cannot get rid of it unless I
replace the report with the one from my safety copy. And the story repeats
again.

The code I am inserting is "docmd.maximized". Thats all. Immediately after
that I get some other errors inside report - "Name?" - for some controls
which contains the following kind of expressions : =Iif(test=0,
"profile","operations")


Thanks in advance for your support.

Catalin
 
K

Ken Snell \(MVP\)

Give us an exzample of the VBA code (entire procedure) that you're using as
the event procedure's programming. You are not putting "DoCmd.Maximize"
directly in the box next to "On Activate" on the Event tab in the Properties
popup window, are you?
 
C

Catalin

Yes I do.
I put only "DoCmd.Maximize".

Catalin

Ken Snell (MVP) said:
Give us an exzample of the VBA code (entire procedure) that you're using as
the event procedure's programming. You are not putting "DoCmd.Maximize"
directly in the box next to "On Activate" on the Event tab in the Properties
popup window, are you?
 
K

Ken Snell \(MVP\)

That is not the way to do it.

In that box, select "[Event Procedure]" from the dropdown box. Then click on
the three-dot button at far right of the box -- this will open the Visual
Basic Editor (VBE), and you'll see that the cursor is on a blank line
between a code line above it (Private Sub xxxxx) and a code line below it
(End Sub). Type the DoCmd.Maximize in that blank line. Close the VBE. Save
the form. Close the form. Open the form in normal view; it should work for
you now.
 
C

Catalin

Dear Ken,

I am sorry that I misslead you. I didn't carefuly read your reply. When I
said that I wrote only "docmd.maximize" I meant inside the "private"
procedure within VBE.

So, I have respected all the rules concernng events and still the error
persists.

What can be wrong?

Catalin

Ken Snell (MVP) said:
That is not the way to do it.

In that box, select "[Event Procedure]" from the dropdown box. Then click on
the three-dot button at far right of the box -- this will open the Visual
Basic Editor (VBE), and you'll see that the cursor is on a blank line
between a code line above it (Private Sub xxxxx) and a code line below it
(End Sub). Type the DoCmd.Maximize in that blank line. Close the VBE. Save
the form. Close the form. Open the form in normal view; it should work for
you now.

--

Ken Snell
<MS ACCESS MVP>



Catalin said:
Yes I do.
I put only "DoCmd.Maximize".

Catalin
 
K

Ken Snell \(MVP\)

By the combination of the problems that you describe, it appears that the
report is becoming corrupted somehow when you try to use it. The fact that
your textboxes start to show "#Name?" errors indicates that the report has
"lost" its recordsource, or the textbox with the expression in it has the
same name as a field in the recordsource.

What is the name of the textbox with the IIf expression (that you posted) as
the control source?
--

Ken Snell
<MS ACCESS MVP>




Catalin said:
Dear Ken,

I am sorry that I misslead you. I didn't carefuly read your reply. When I
said that I wrote only "docmd.maximize" I meant inside the "private"
procedure within VBE.

So, I have respected all the rules concernng events and still the error
persists.

What can be wrong?

Catalin

Ken Snell (MVP) said:
That is not the way to do it.

In that box, select "[Event Procedure]" from the dropdown box. Then click
on
the three-dot button at far right of the box -- this will open the Visual
Basic Editor (VBE), and you'll see that the cursor is on a blank line
between a code line above it (Private Sub xxxxx) and a code line below it
(End Sub). Type the DoCmd.Maximize in that blank line. Close the VBE.
Save
the form. Close the form. Open the form in normal view; it should work
for
you now.

--

Ken Snell
<MS ACCESS MVP>



Catalin said:
Yes I do.
I put only "DoCmd.Maximize".

Catalin

:

Give us an exzample of the VBA code (entire procedure) that you're
using
as
the event procedure's programming. You are not putting
"DoCmd.Maximize"
directly in the box next to "On Activate" on the Event tab in the
Properties
popup window, are you?

--

Ken Snell
<MS ACCESS MVP>


Dear friends,

I am confronting with an error and I do not know why it appears and
how
I
can get rid of it.

The error comes when I write a code in ANY of the event methods of
the
report - On Activate, On Open etc.

The error message is: "The expression On Activate you entered as the
event
property setting produced the following error: A problem occured
while
Access
was communicating with the OLE server or Activex control"

On Activate is replaced with On Open if I use this event. Now even
if I
delete the code, the error still persists and I cannot get rid of it
unless I
replace the report with the one from my safety copy. And the story
repeats
again.

The code I am inserting is "docmd.maximized". Thats all. Immediately
after
that I get some other errors inside report - "Name?" - for some
controls
which contains the following kind of expressions : =Iif(test=0,
"profile","operations")


Thanks in advance for your support.

Catalin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top