OLE Objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

I have an mdb table with 4 columnns. The second column is the unique ID of
the record, the third column is an embedded OLE object which, when you edit
the package's command line, it is a reference to the file to be launched when
clicked. Is there are way (query/VBA) that extracts the cmd line and pastes
it into the a 4th column as a string?

Is there a way I can attached an example with 4 records to explain it better?

Thanks in advance
JMG
 
JMG said:
Dear All,

I have an mdb table with 4 columnns. The second column is the unique ID of
the record, the third column is an embedded OLE object which, when you edit
the package's command line, it is a reference to the file to be launched when
clicked. Is there are way (query/VBA) that extracts the cmd line and pastes
it into the a 4th column as a string?

Is there a way I can attached an example with 4 records to explain it better?

Thanks in advance
JMG

JMG,

Try adding this code:

dim sCmdLine as String
dim lRecID as Long
sCmdLine = Command

'perform any validation you need to do here
'Set lRecID = the ID of the record you want to update here.

currentproject.accessconnection.execute "UPDATE <TABLENAME> SET
<TABLENAME>.<FOURTHFIELDNAME> = '" & sCmdLine & "' WHERE
(<TABLENAME>.<IDFIELDNAME> = " & lRecID & ");"

You will need to replace the table and field names appropriately.
Also, you could copy and paste the SQL there to the query builder,
amend the names and save it as a query to run if you are happier with
that.

Hope this helps.

Chris.
 

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