Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report event error

Status
Not open for further replies.

CatalinAnd

Technical User
Sep 6, 2007
3
RO
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 or 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 in VBE is only "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 : =Iiftest=0, "profile","operations")


Thanks in advance for your support.

Catalin
 
This isn't going to work very well either:
=Iiftest=0, "profile","operations")

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes I mean only Docmd.Maximize sorry.
And the formula is =Iif(test=0, "profile","operations")

Both were typing errors in the thread but inside the application are correct.

Any ideas?

Thanx,
Catalin
 
Hi,

The name of the textbox which contains the Iif expression is Text32 and has nothing to do with the field names or any other control name in the report.

I have tried many things since last week and I can tell you in what conditions I get the error.
First, if I use just the name of the field inside the controlsource property I get no error and everything is fine just like the other controls in the report. But when I try to write an expression (even simple one like "=test" where test is a field name) I receive the error "#Name?". The expression is automatically changed to "=[test]" and the error occurs.

I tried to write some simple code in VB in "On Print" event and I receive the error that I have mentioned in my first post regarding the communication with OLE server a.s.o.

I think that by changing the name with the square brackets triggers the error.

This is very awkward because I use a lot of these kind of expressions in my reports and this is actually the first time when I face this problem. By replacing the report with the one (identical report !!) saved in the back-up file cleares the problem which is also strange.

Any ideas?

Thanks for your help.

Catalin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top