Hi
I have below code . I want to print image in Crystal Report dynamically. I am using VB6
VB.NET
Private Sub Section5_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture(rs!C_Image)
End SubThanks
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 SubThanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Emily FosterRank #3,495 · 415 reputationPosted Apr 15, 2025, 7:01 AM EDT
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:
Private Sub Section5_Format(ByVal pFormattingInfo As Object) Set Picture1.FormattedPicture = LoadPicture(rs!C_Image) End SubThe 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:
Private Sub Section5_Format(ByVal pFormattingInfo As Object) Picture1.FormattedPicture = LoadPicture(rs!C_Image) End SubBy 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.