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

Linking to pictures

Status
Not open for further replies.

weeze2

Technical User
Jun 18, 2002
129
DK
I have a table that holds text links to pictures. ´The pictures are showed in a Form with the following code

where txtPicture is a textbox with part of the link and Picture is a picture element on the report.
'*****************************************************
Private Sub Form_Current()
On Error GoTo err_Form_Current
If Not Me!txtPicture = "" Or Not IsNull(Me!txtPicture) Then
Me!Picture.Picture = "c:/Picture/" + Me!txtPicture + ".bmp"
Else
Me!Picture.Picture = ""
End If
exit_Form_Current:
Exit Sub
err_Form_Current:
MsgBox Err.Description
Resume exit_Form_Current
End Sub

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If IsNull(Me!txtPicture) Or Me!txtPicture = "" Then
' do nothing
Else
Me!Picture.Picture = "c:/Picture/" + Me!txtPicture+ ".bmp"
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
'******************************************************

and I need to show the pictures in a Report. Can anyone help me with how the code should change and where it should be. i tried putting
Me!Picture.Picture = "c:/Picture/" + Me!txtPicture+ ".bmp"
in the Format of the detail section but the picture does not show.
 
Hi,
You need to use the "LoadPicture" function. HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top