Access 2003 and OLE.

  • Thread starter Thread starter James Lee
  • Start date Start date
J

James Lee

I have recently upgraded to Access 2003 from 2000. An application that
worked perfectly well under 2000 is now presenting problems when I try
to run it under 2003.

It hangs up with the error message "The object you referenced in the
VB procedure as an OLE object isn't an OLE object." when it tries to
execute a macro in the VB code.

The macro changes the status of the "Visible" property of a command
button to "No" using the SetValue feature. This is conditional on the
existing status of that property and is only being called when it is
"Yes".

This seems to be somewhat similar to the topics discussed in a thread
raised by Fritzz Anton back on 4 December 2003. This thread had 12
entries and although it included a couple from Microsoft did not seem
to reach any definite conclusion.

Jet 4.0 SP8 has been installed.

I have searched for FAQ's etc. elsewhere without success. Has anyone
any ideas?

James Lee.
 
I'm not sure what it is you are trying to do with VB and a macro, but the
simple thing to do is to set the command button visible property directly in
VB based on whatever event you are working with. Example if your button
depends on some data in a text field then the code would look something like
this.

Sub MyTextField_AfterUpdate()
'MyTextField must contain a string value of one or more characters to
make
this button visible.
MyCommandBtn.visible = (nz(MyTextField,"")<>"")
End Sub

Rather than changing the visible property you might also consider changing
the enabled property instead. This would depend on your needs.

Hope this helps out, best of luck!
 
Devlin: Thank you very much for your response and my apologies for
taking so long to acknowledge, I have been away from that project for
a while.

I had started a work around along the lines you suggested and your
advice was reassuring. I have managed this successfully now in one
instance but I've got at least a couple of dozen or so more to do as
well which is not exactly enamouring me of 2003. I am indeed also
using the "enabled" property, however I have used the "Visible" one as
well to keep things a bit less cluttered.

Again many thanks and best regards

James
 
holle
??
James Lee said:
Devlin: Thank you very much for your response and my apologies for
taking so long to acknowledge, I have been away from that project for
a while.

I had started a work around along the lines you suggested and your
advice was reassuring. I have managed this successfully now in one
instance but I've got at least a couple of dozen or so more to do as
well which is not exactly enamouring me of 2003. I am indeed also
using the "enabled" property, however I have used the "Visible" one as
well to keep things a bit less cluttered.

Again many thanks and best regards

James




Devlin <[email protected]> wrote in message
 

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

Back
Top