Hi the code below gets images stores the id and filename to the table tExternal.
My problem is highlighted in red, what seems to happen it only pics the first filename and copies that to the database.
eg.
id hospno
1 snap1.jpg
2 snap1.jpg
3 snap1.jpg
What i would like it to do is move to the next filename and copy that to hospno e.g
id hospno
1 snap1.jpg
2 old.jpg
3 snap3.jpg
I know am nearly there of solving this one but need some assitance with this.
Private Sub DBPixMain_ImageModified()
Dim strFileName As String
Dim strFolderName As String, strDirectory As String
DBPixThumb.Image = Null ' Clear the thumbnail
Me("ThumbWidth") = 0 ' Reset image info (and force update of Id if new record)
Me("ThumbHeight") = 0
Me("DetailWidth") = 0
Me("DetailHeight") = 0
strDirectory = "C:\Database\Images\"
' strTest = GetFileName(strFolderName)
strFileName = Dir(strDirectory & "*.*", vbNormal)
' Me.txtFileHyperlink = strInputFileName
'
If DBPixMain.ImageBytes > 0 Then
' Update the thumbnail
DBPixThumb.ImageLoadBlob (DBPixMain.Image) ' Copy/Paste is faster, if you don't mind overwriting the clipboard
' DBPixMain.ImageCopy
' DBPixThumb.ImagePaste
''
If DBPixMain.ImageSaveFile(GetImgFolder & Me!ItemId & ".jpg") Then
Do
Me("hospno") = strFileName
Exit Do
Loop
' Me("DetailWidth") = DBPixMain.ImageWidth ' Uppdate Detail image info
' Me("DetailHeight") = DBPixMain.ImageHeight
'
If DBPixThumb.ImageSaveFile(GetImgFolder & "t" & Me!ItemId & ".jpg") Then
' Me("ThumbWidth") = DBPixThumb.ImageWidth ' Update the thumbnail image info
' Me("ThumbHeight") = DBPixThumb.ImageHeight
End If
End If
End If
End Sub
Many thanks
My problem is highlighted in red, what seems to happen it only pics the first filename and copies that to the database.
eg.
id hospno
1 snap1.jpg
2 snap1.jpg
3 snap1.jpg
What i would like it to do is move to the next filename and copy that to hospno e.g
id hospno
1 snap1.jpg
2 old.jpg
3 snap3.jpg
I know am nearly there of solving this one but need some assitance with this.
Private Sub DBPixMain_ImageModified()
Dim strFileName As String
Dim strFolderName As String, strDirectory As String
DBPixThumb.Image = Null ' Clear the thumbnail
Me("ThumbWidth") = 0 ' Reset image info (and force update of Id if new record)
Me("ThumbHeight") = 0
Me("DetailWidth") = 0
Me("DetailHeight") = 0
strDirectory = "C:\Database\Images\"
' strTest = GetFileName(strFolderName)
strFileName = Dir(strDirectory & "*.*", vbNormal)
' Me.txtFileHyperlink = strInputFileName
'
If DBPixMain.ImageBytes > 0 Then
' Update the thumbnail
DBPixThumb.ImageLoadBlob (DBPixMain.Image) ' Copy/Paste is faster, if you don't mind overwriting the clipboard
' DBPixMain.ImageCopy
' DBPixThumb.ImagePaste
''
If DBPixMain.ImageSaveFile(GetImgFolder & Me!ItemId & ".jpg") Then
Do
Me("hospno") = strFileName
Exit Do
Loop
' Me("DetailWidth") = DBPixMain.ImageWidth ' Uppdate Detail image info
' Me("DetailHeight") = DBPixMain.ImageHeight
'
If DBPixThumb.ImageSaveFile(GetImgFolder & "t" & Me!ItemId & ".jpg") Then
' Me("ThumbWidth") = DBPixThumb.ImageWidth ' Update the thumbnail image info
' Me("ThumbHeight") = DBPixThumb.ImageHeight
End If
End If
End If
End Sub
Many thanks