I have problem here, I want to print all image on database. When I try that code and navigate the the data report during run time, only text change but the image still don't change, It should change the image according the record. Why?
Code:' On the form ''Print all record Unload Me frmMenu.Picture2.Cls frmMenu.Picture2.AutoRedraw = True frmMenu.Picture2.ScaleMode = vbPixels On Error GoTo error: frmMenu.Picture2.PaintPicture LoadPicture(Pesttable.Fields("Gambar")), 0, 0, 200, 200 Set reportperosak.DataSource = Pesttable reportperosak.Show
Code:Private Sub DataReport_Initialize() On Error GoTo error 'show the image from database to prit the form 'Set Me.Sections("Section1").Controls("Image1").Picture = LoadPicture(Pesttable.Fields("Gambar")) 'scale image from the image on formMenu to display on image in datareport Dim oPic As StdPicture Dim oImgControl As RptImage Set oPic = LoadPicture(Pesttable.Fields("Gambar")) Set oImgControl = reportperosak.Sections("Section1").Controls("Image1") oImgControl.SizeMode = rptSizeStretch oImgControl.Width = frmMenu.ScaleX(200, vbPixels, vbTwips) oImgControl.Height = frmMenu.ScaleY(200, vbPixels, vbTwips) Set oImgControl.Picture = oPic error: End Sub




Reply With Quote