Unbound Attachment Field

TajikBoy

Member
Local time
Today, 07:22
Joined
Mar 4, 2011
Messages
83
Good morning/afternoon/evening guys,

I want to place a field (unbound) on my form (Unbound), which will display a record from another table which contains one record with an attachment, to serve the said file as template so user can open, use and save somewhere else

How can I link this unbound attachment field to the table contains the record?
 
Bind it... Or use DLookup as an alternative.
Also bear in mind that attachment fields cause bloat and aren't recommended by most developers.
 
what file type is the Attachment?

you can have a Text column for your table that will Hold the Path (fixed location) of the
Modified attachment file.

you can have an Image control on the form.
add code to the Click event to Extract (on a Fixed location) and Show the
Attachment.
 
what file type is the Attachment?

you can have a Text column for your table that will Hold the Path (fixed location) of the
Modified attachment file.

you can have an Image control on the form.
add code to the Click event to Extract (on a Fixed location) and Show the
Attachment.
Hi Arnel.......

Its an excel file - i just want user to open the file, no save back

add code to the Click event to Extract - what would be the code, not that expert like you guys , yet.....
 
Bind it... Or use DLookup as an alternative.
Also bear in mind that attachment fields cause bloat and aren't recommended by most developers.

Used Dlookup but didnt work, also placed in on load event to populate, gave runtime error 438 Object doesn't support this property or method

FOr this field, there's no write back, single record, holding a template file
 
see this demo.

Thanks Arnel, that looks awesome but, my aim is not to save the file somewhere, just put the attachment from tblADCB to the unbound field on the form called ADCB

With my limited experience on VBA, I extracted below, which I assume takes the attachment and saves it, but instead of saving, I want it in the unbound field

Set db = CurrentDb
Set rsP = db.OpenRecordset("select top 1 * from tblADCB;", dbOpenDynaset)
With rsP
If Not (.BOF And .EOF) Then
.MoveFirst
'open the attachment field as recordset
Set rsC = .Fields("ADCBFile").Value
ADCB = rsC <---- in here I need the attachment in ADCB
Set rsC = Nothing
End If
.Close
End With
Set rsP = Nothing
 
Make it a subform with just the attachment field and navigate to that field.
 
you can also use a Bound Single form if that is your ultimate goal and not post#1 (unbound).
 

Users who are viewing this thread

Back
Top Bottom