Hi
I have below code . I want to print image in Crystal Report dynamically. I am using VB6
Private Sub Section5_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture(rs!C_Image)
End Sub
Thanks
Hi
I have below code . I want to print image in Crystal Report dynamically. I am using VB6
Private Sub Section5_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture(rs!C_Image)
End Sub
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Emily FosterPosted Apr 15, 2025, 11:01 AM
Hello! It seems like you are encountering the "Error - Object required" in your VB6 code snippet. This error typically occurs when you try to access a property or method of an object that is not set or initialized. In your specific code snippet:
The error is likely arising from the use of `Set` when setting the `FormattedPicture` property of `Picture1`. In VB6, the `Set` keyword is used to assign object references, but in this case, `FormattedPicture` may not be an object that requires the `Set` keyword.
To address this error, you can try removing the `Set` keyword:
By removing `Set`, you are directly assigning the result of `LoadPicture(rs!C_Image)` to the `FormattedPicture` property of `Picture1`.
This adjustment should help resolve the "Error - Object required" you are encountering. If you face any further issues or need additional clarification, feel free to ask.