Dynamically update an Unbound Object (1 Viewer)

M

martinc98

Guest
Can anyone tell me if this is possible and how I might do it??

I want to create a "dynamic" unbound object on a form.

Specifically, I store a filename in my record...I want to allow a preview of this file in an unbound object field on the form.

For example, if the file name for the current record is "junk.doc", I want to dynamically update the contents of the unbound object box to link to that file. The next record would reference a different filename, so the "preview box" would change as you move thru the records.

I tried creating an event to update the SOURCEDOC property, but this seems to have no effect.

Any ideas??

Thanks!
 
M

martinc98

Guest
No takers on this one??

I've tried a few other tacks, all without luck...

I can modify the value of unboundobject.SourceDoc, but this seems to do no good...I assume this is locked in at form creation time??

There's also a "Source Item" property, but I can't figure out what this one does...

I could create an OLE field in the record...but I'd then need to dynamically link to the specified file name for that particular record.

I can do this manually by right-clicking, select insert object, specify from file, select MS Word, select link, and then pick the filename by browsing...

Is it possible to automate this so it all happens automatically whenever the record changes??

My whole goal here is to just have a small preview window to allow the user to get a glimpse of the referenced word doc file before they select to actually edit it (they can click on an edit button and word opens up the file and lets them edit it), it's tedious to go into word only to find that this was not the file they wanted...
 

bdphifer

New member
Local time
Today, 03:27
Joined
Mar 3, 2003
Messages
1
Has anyone ever solved this issue?

I am running into a similar problem.

Blair
 

Not A PHB

Registered User.
Local time
Yesterday, 22:27
Joined
Oct 1, 2002
Messages
17
Me too!

I would love an answer to this problem. I can't figure it out.

Thanks

Lance
 

DKDiveDude

Registered User.
Local time
Yesterday, 22:27
Joined
Mar 28, 2003
Messages
56
Please forgive my crude example without any error catching, but I didn't have much time.

Option Compare Database

Private Sub Form_Current()
If txtFileName > "" Then
Dim strFile As String
Open txtFileName For Input As #1
Input #1, strFile
Close #1

txtPreview = strFile
End If
End Sub


txtFileName is the form field and/or control source name that stores the filename. Note: If the file is NOT stored in the same folder as the database you will have to specify that too!

txtPreview is the unbound field name where you want your preview

Then set the form to catch the Current event, where you paste the above PRIMITIVE example.

I hope this help a bit...or at least point you in the right direction
 
Last edited:

Not A PHB

Registered User.
Local time
Yesterday, 22:27
Joined
Oct 1, 2002
Messages
17
Thanks for the quick reply!

That does get me closer to what I was looking for and I'm going to use it if I can't get my linked object to update which it looks like I can't :confused:

I think what I'm going to do is use your code for the preview and add a double click event that will open word and the entire file. Thanks again for responding :)

Lance
 

Users who are viewing this thread

Top Bottom