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.
Eliana BlakePosted Apr 15, 2025, 11:01 AM
Hi there!
The "Error - Object required" in your VB6 code typically occurs when there is a mismatch in how an object is being referenced or set. In your specific case, the issue lies in the line:
Here, the `Picture1` control is being referenced as an object that needs to be set but without actually being declared or instantiated. To resolve this error, you need to make sure that `Picture1` is correctly defined as an object before using it. In VB6, you can declare and set controls like `Picture1` by adding it to your form design.
Here's a basic example of how you can declare and set a Picture control in VB6:
In this revised code snippet, `Picture1` is declared as an Object and then explicitly assigned the Picture control from the form using `Me.Controls("Picture1")`. This way, you ensure that `Picture1` is properly referenced as an object before attempting to set its properties.
Remember to adjust the control name "Picture1" to match the actual name of the Picture control on your Crystal Report form.
I hope this helps you resolve the "Error - Object required" and successfully print images in your Crystal Report dynamically. If you have any more questions or need further assistance, feel free to ask!