Hi there
I'm trying to put some code behind a button to insert an ole object.
The field in my table is called ImageLocatin, and when I click the button I want it to look for the jpg in the location specified where the jpg is called forename surname.jpg, and insert it into the relevant field.
I have tried the following but it doesn't seem to recognise the Surname part!
Private Sub Command617_Click()
Dim rs As Recordset
rs.Open "tblpeople", CurrentProject.Connection, adOpenStatic, adLockOptimistic
Me.OLEDoc.SourceDoc = "R:\Images and Photos\" & "\" & rs!Forename & " " & rs!Surname & ".jpg"
Me.OLEDoc.OLETypeAllowed = acOLELink
Me.OLEDoc.Action = acOLECreateLink
End Sub
Am I doing something wrong here?
Thanks in advance,
Noel.
I'm trying to put some code behind a button to insert an ole object.
The field in my table is called ImageLocatin, and when I click the button I want it to look for the jpg in the location specified where the jpg is called forename surname.jpg, and insert it into the relevant field.
I have tried the following but it doesn't seem to recognise the Surname part!
Private Sub Command617_Click()
Dim rs As Recordset
rs.Open "tblpeople", CurrentProject.Connection, adOpenStatic, adLockOptimistic
Me.OLEDoc.SourceDoc = "R:\Images and Photos\" & "\" & rs!Forename & " " & rs!Surname & ".jpg"
Me.OLEDoc.OLETypeAllowed = acOLELink
Me.OLEDoc.Action = acOLECreateLink
End Sub
Am I doing something wrong here?
Thanks in advance,
Noel.