Viewing attachments from form (Datasheet view) (1 Viewer)

dale_j1992

Registered User.
Local time
Today, 21:35
Joined
Sep 23, 2016
Messages
26
Good evening, i am currently creating a subform that will be shown in datasheet view on my main form. i am doing this just to show recent records of inspection results in a datasheet format, i have got an attachment field which is an in image, is there any way of setting up this datasheet form so that when the user hovers the mouse over the attachment it will show in a window? any help is greatly appreciated :)
 

static

Registered User.
Local time
Today, 21:35
Joined
Nov 2, 2015
Messages
823
Sure.
Create another form and add an attachment control

When the mouse moves over the control on the main form, open the new form and set the recordsource of the form and control source of the attachment.

Code:
Private Sub attachment0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
	DoCmd.OpenForm "MyOtherform"
	Forms!MyOtherform.RecordSource = "select MyAttachment from MyTable where id = " & id
	Forms!MyOtherform!MyAttachment.ControlSource = "MyAttachment"
end sub
 

dale_j1992

Registered User.
Local time
Today, 21:35
Joined
Sep 23, 2016
Messages
26
Hello thanks for the reply i am relatively new too access could you help me out with were i need to insert that code and what i need to change to suit my database. many thanks
 

Users who are viewing this thread

Top Bottom