.visible = not .visible

P

PsyberFox

I'm getting the following error:

"The expression On Timer you entered as the event property setting produced
the following error: A problem occured while MSA was communicating with the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another form, and
it works fine... please help!

Thank you!
 
A

Allen Browne

Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html
 
P

PsyberFox

I only have this single sub on this form... and compile and decompile does
nothing...
W

Allen Browne said:
Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
I'm getting the following error:

"The expression On Timer you entered as the event property setting
produced
the following error: A problem occured while MSA was communicating with
the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another form,
and
it works fine... please help!

Thank you!
 
A

Allen Browne

There is something drastically wrong here.

I don't see how the app can compile if the code is invalid.

Make sure you have:
Option Explicit
at the top of this module.

Then be explicit about what you are referring to, i.e.:
Me.lblRememberInfo.Visible = Not Me.lblRememberInfo.Visible

Copy everything from this module out to Notepad, and save it.
Then set the form's HasModule property to No.
Answer yes: you do want to lose all the code.
Compact.
Compile
Test the database.
Is the problem still there?

(One you have tracked the culprit down, you will paste the code back into
the form's module, of course.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
I only have this single sub on this form... and compile and decompile does
nothing...
W

Allen Browne said:
Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html

PsyberFox said:
I'm getting the following error:

"The expression On Timer you entered as the event property setting
produced
the following error: A problem occured while MSA was communicating with
the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another form,
and
it works fine... please help!
 
S

Stefan Hoffmann

hi,
"The expression On Timer you entered as the event property setting produced
the following error: A problem occured while MSA was communicating with the
OLE server or ActiveX Control."
I have the same settings and a similar event procedure on another form, and
it works fine... please help!
In some cases this indicates a broken ActiveX registration or a broken
reference...


mfG
--> stefan <--
 
P

PsyberFox

Hi,

I've followed your suggestions... and this is what I've found:
1. I've removed all code from this form.
2. All other buttons' code works from all other forms - tested all
3. Compact; Compile - no problem
4. As soon as I add any code on this form, even something as simple as
merely opening another form and closing this one, then it gives exactly the
same error...

Rgds,

Allen Browne said:
There is something drastically wrong here.

I don't see how the app can compile if the code is invalid.

Make sure you have:
Option Explicit
at the top of this module.

Then be explicit about what you are referring to, i.e.:
Me.lblRememberInfo.Visible = Not Me.lblRememberInfo.Visible

Copy everything from this module out to Notepad, and save it.
Then set the form's HasModule property to No.
Answer yes: you do want to lose all the code.
Compact.
Compile
Test the database.
Is the problem still there?

(One you have tracked the culprit down, you will paste the code back into
the form's module, of course.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
I only have this single sub on this form... and compile and decompile does
nothing...
W

Allen Browne said:
Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html

I'm getting the following error:

"The expression On Timer you entered as the event property setting
produced
the following error: A problem occured while MSA was communicating with
the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another form,
and
it works fine... please help!
 
A

Allen Browne

Assuming there are no ActiveX controls on this form, you might try the
SaveAsText/LoadFromText trick here:
http://allenbrowne.com/ser-47.html#SaveAsText
Don't skip any of the steps.

If you have not yet done so, it would be worth compling the recovery
sequence in order:
http://allenbrowne.com/recover.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
Hi,

I've followed your suggestions... and this is what I've found:
1. I've removed all code from this form.
2. All other buttons' code works from all other forms - tested all
3. Compact; Compile - no problem
4. As soon as I add any code on this form, even something as simple as
merely opening another form and closing this one, then it gives exactly
the
same error...

Rgds,

Allen Browne said:
There is something drastically wrong here.

I don't see how the app can compile if the code is invalid.

Make sure you have:
Option Explicit
at the top of this module.

Then be explicit about what you are referring to, i.e.:
Me.lblRememberInfo.Visible = Not Me.lblRememberInfo.Visible

Copy everything from this module out to Notepad, and save it.
Then set the form's HasModule property to No.
Answer yes: you do want to lose all the code.
Compact.
Compile
Test the database.
Is the problem still there?

(One you have tracked the culprit down, you will paste the code back into
the form's module, of course.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
I only have this single sub on this form... and compile and decompile
does
nothing...
W

:

Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html

I'm getting the following error:

"The expression On Timer you entered as the event property setting
produced
the following error: A problem occured while MSA was communicating
with
the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or
macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another
form,
and
it works fine... please help!
 
P

PsyberFox

OK let me tell you what I've done in the meantime... I copied my form
(without code) over to a slightly older version of the db, also copied the
menu forms and new queries that is run by these forms.

I then copied the code that I saved in notepad for this form back to this
form, and voila! The only thing that I can think of that did change between
these two versions, is a pop-up calendar that I downloaded from one of the
people on this website... the old version did not have this import, although
I deleted all code I could find in my db... so it must'v been something in
it's code that caused this to happen...

Thank you anyways for your help...

Allen Browne said:
Assuming there are no ActiveX controls on this form, you might try the
SaveAsText/LoadFromText trick here:
http://allenbrowne.com/ser-47.html#SaveAsText
Don't skip any of the steps.

If you have not yet done so, it would be worth compling the recovery
sequence in order:
http://allenbrowne.com/recover.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

PsyberFox said:
Hi,

I've followed your suggestions... and this is what I've found:
1. I've removed all code from this form.
2. All other buttons' code works from all other forms - tested all
3. Compact; Compile - no problem
4. As soon as I add any code on this form, even something as simple as
merely opening another form and closing this one, then it gives exactly
the
same error...

Rgds,

Allen Browne said:
There is something drastically wrong here.

I don't see how the app can compile if the code is invalid.

Make sure you have:
Option Explicit
at the top of this module.

Then be explicit about what you are referring to, i.e.:
Me.lblRememberInfo.Visible = Not Me.lblRememberInfo.Visible

Copy everything from this module out to Notepad, and save it.
Then set the form's HasModule property to No.
Answer yes: you do want to lose all the code.
Compact.
Compile
Test the database.
Is the problem still there?

(One you have tracked the culprit down, you will paste the code back into
the form's module, of course.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

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

I only have this single sub on this form... and compile and decompile
does
nothing...
W

:

Open the code window, and choose Compile on the debug menu.

That should lead you to the line that Access it not able to compile.
(It could be anywhere in your app.)

If it compiles okay, run a decompile.
This recovery sequence should pin it down:
http://allenbrowne.com/recover.html

I'm getting the following error:

"The expression On Timer you entered as the event property setting
produced
the following error: A problem occured while MSA was communicating
with
the
OLE server or ActiveX Control.
The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
There may have been an error evaluating the function, event, or
macro."

The event procedure is as follows:

Private Sub Form_Timer()
lblRememberInfo.Visible = Not lblRememberInfo.Visible
End Sub

And the Timer Interval is set to 500.

I have the same settings and a similar event procedure on another
form,
and
it works fine... please help!
 

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