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

Setting OLE Field Properties using VBA

Status
Not open for further replies.

NOPOPNOSTYLE

IS-IT--Management
Apr 9, 2002
38
GB
Hi there

I have a Table with 2 Fields, NAME (text) and NOTES (OLE)

I have created a Form to Dispay the Data, I've used the manual method of Using Insert Object and Selecting Microsoft Word Document as the object to be placed in the Vacant (this is all Bound) OLE Field in the Table. All Fine so far, however the Form is to be used by Users, every new record They create using the Form need a Microsoft Word Document bound to the new Row in the Table.

In testing when I create a new record/row in the form the OLE Field is empty. I've tried mucking around with the Before Insert properties in the Form Design but can't find a way of setting the OLE Fields Property Every time I create a new record/row.

Arrrghh

Please help

John
 
You may need to create a Word doc, then link the record to it, then requery. I don't know if you can use the OLE control object to create the Word file, but, if you can, that would be good. You can create a Word file from Access, but I don't know if you can do it without a table. If not, maybe just look at another field or create a dummy table to export.

Depending on where you put the code, you can add a record with NOTES pointing to the new file, or you can find the record just created and point NOTES to the new file. (You can use a Recordset object with the table.)

After pointing NOTES to the new file, requery the form and set the bookmark. (You need to copy the bookmark into a bookmark object before doing everything else. Afterward, set the form's bookmark to the object. bkm = Me.Bookmark ... Me.Bookmark = bkm)

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top