Please help this Newbee,
I have searched the Forum and was unable to find an answer.
I am trying to take an image from an Access97 database (.mdb) and place it
in an image control. Here is some of the code I am trying to use.
I am getting an Invalid Picture error, Any and All help would be greatly
appreciated by this NEWB.
Invalid Picture Error.
As a NOTE if it makes any difference. The ActualSize shows as 840066, but the pictemp.bmp file is 840078 exactly 12 bytes greater.
Sample Code would be a Life Saver.
Thanks in Advance,
Ferlin
I have searched the Forum and was unable to find an answer.
I am trying to take an image from an Access97 database (.mdb) and place it
in an image control. Here is some of the code I am trying to use.
I am getting an Invalid Picture error, Any and All help would be greatly
appreciated by this NEWB.
Code:
Option Explicit
Dim mIPicture As Variant
Dim FileNum As Integer
Dim DiskFile As String
.
.
.
Private Sub LoadControls()
With mrsITEM
txtItemNumber = !ItemNumber & ""
rchtxtDescription = !Description & ""
txtRetailPrice = !RetailPrice & ""
txtWhitePrice = !WhitePrice & ""
txtYellowPrice = !YellowPrice & ""
txtBluePrice = !BluePrice & ""
txtWOPPageNumber = !WOPPageNumber & ""
End With
FileNum = FreeFile
Me.MousePointer = vbHourglass
' Remove any existing destination file.
DiskFile = App.Path & "\data\pictemp.bmp"
If Len(Dir$(DiskFile)) > 0 Then
Kill DiskFile
End If
Open DiskFile For Binary As FileNum
mIPicture =
mrsITEM!ItemPicture.GetChunk(mrsITEM!ItemPicture.ActualSize)
Put FileNum, , mIPicture
Close FileNum
Image1.Picture = LoadPicture(DiskFile)
Code:
Me.MousePointer = vbArrow
End Sub
Sample Code would be a Life Saver.
Thanks in Advance,
Ferlin