Dim imageDomain As String
Dim imagePath As String
Dim rotatePath As String
Dim rotateBool As Boolean
Dim imageRotator As Integer
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT Afbeelding FROM Products")
imageDomain = CurrentProject.Path & "\folder\"
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Do Until rs.EOF = True
If Not IsNull(rs!Afbeelding) Then
rotatePath = imageDomain & "rotate\" & rs!Afbeelding
rotateBool = Len(Dir(rotatePath))
If Not rotateBool Then
imagePath = imageDomain & rs!Afbeelding
imageRotator = Shell("cmd.exe /c convert.exe -rotate ""270"" " & imagePath & " " & rotatePath)
End If
End If
rs.MoveNext
Loop
Else
MsgBox "There are no records in the recordset."
End If
rs.Close
Set rs = Nothing