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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE values

Status
Not open for further replies.

stuandwil

Technical User
Apr 16, 2004
24
GB
I have several OLE links from Excel which read values in from PLC's which are then pasted/linked on a form in Access. They display live data on my form (machine on/off) and all work fine. Is there any way to use the value of an OLE field to trigger an event. On updated is no use because the links are always updating, on change is not available for an OLE Field. Can I test for is null somehow or is this a no go situation.

Many thanks
Stuart
 
The short answer to what I believe you are asking is no. That said, someone will dispute my answer and come up with some means to do it using OLE automation or an API call or something. I consider an answer no if the software does not allow the developed to perform the function without significant effort to develop interfacing code.

By 'OLE Field' I am assuming you mean a cell in an Excel file and not a property of the OLE container control. When an OLE Object such as Excel is pasted into a form then these are two separate applications. Please understand that you have essentially made a design decision by pasting an OLE Object into a form. There are other means of accessing the data which may allow you to trigger a pseudo event in your code. You could link Access to the live Excel file and use the data is a control. When clicking the control you could check the value in the control and the most current value in the live data; if different perform something. I AM NOT suggesting this but only stating it to let you know that it is possible, and, depending on your requirements, and the amount of free time you have, could possibly be implemented.



---------------------
scking@arinc.com
---------------------
 
Yes I am using just cell values, I didn't think of perhaps doing a linked table which maybe I can work with. Reading in values I suppose rather than an object. I will try this out, many thanks for the reply.
 
Forgot to mention that the pop ups I need are easily available in excel itself but the access form i use sits on top and messages in excel do not appear on top when coming in, so unless you are looking at the excel sheet you don't see the message.
Maybe there is a way I can get the popup on top.
 
You may consider the AppActivate instruction.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Using the appactivate didn't seem to have the desired effect it just opened up another instance of access, instead of giving the existing open database focus.
 
The AppActivate VBA instruction shouldn't instantiate new object, just activate an existing one based on the contents of the title bar.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes you are correct I have it now, I was trying to put the file name in there rather than the title. Many thanks I think this instruction will do what i need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top