I'm trying to display an image which is saved in the table as an OLE Object in a message box. The field with the object is "PowerCurve". This is what I'm trying to do. It allows me to get as far as clicking yes to view the second message box but then it results in an error when it tries to display the image. Any ideas?
I get the error "Object variable or With block variable not set" on the line
image = DLookup("PowerCurve", "DeviceT", "DeveloperProduct = '" & Forms!DeviceF!D_ExistingDeviceCmb & "'")
Code:
Dim strDetails As String
strDetails = DLookup("Details", "ExistingDeviceDetailsQ")
Dim strCurve As String
strCurve = DLookup("PCurve", "DeviceT", "DeveloperProduct = '" & Forms!DeviceF!D_ExistingDeviceCmb & "'")
If strCurve = "No" Then
MsgBox strDetails, , "Device Details"
Else
Dim DeviceDetails As Integer
DeviceDetails = MsgBox(strDetails & vbCrLf & " " & vbCrLf & "Do you wish to view device power curve/matrix?", vbYesNo, "Device Details")
Dim image As Object
image = DLookup("PowerCurve", "DeviceT", "DeveloperProduct = '" & Forms!DeviceF!D_ExistingDeviceCmb & "'")
If DeviceDetails = vbYes Then
MsgBox image
Else
End If
End If
I get the error "Object variable or With block variable not set" on the line
image = DLookup("PowerCurve", "DeviceT", "DeveloperProduct = '" & Forms!DeviceF!D_ExistingDeviceCmb & "'")