Mansoor Ahmad
Registered User.
- Local time
- Today, 12:04
- Joined
- Jan 20, 2003
- Messages
- 140
Dear All
I am using the following objects on the form to display images;
One text box that holds image paths (txtimagepath)
An unbound object frame (myimagebox1)
Following is the code being used:
Private Sub Form_Current()
On Error Resume Next
If Not IsNull(Me![txtimagepath]) Then
Me![myimagebox1].OLETypeAllowed = 1
Me![myimagebox1].SourceDoc = Me![txtimagepath]
Me![myimagebox1].Action = 0
End If
End Sub
Private Sub txtimagepath_AfterUpdate()
On Error Resume Next
Me![myimagebox1].OLETypeAllowed = 1
Me![myimagebox1].SourceDoc = Me![txtimagepath]
Me![myimagebox1].Action = 0
End Sub
Now it works fine when image path is available. But when there is no image path in text box, the unbound object frame still displays the last image. When navigating the records it will keep on showing that one image for all next records till there is another image path available.
How can this be solved so that it only shows the image for that record where the image path is mentioned.
Thanks
I am using the following objects on the form to display images;
One text box that holds image paths (txtimagepath)
An unbound object frame (myimagebox1)
Following is the code being used:
Private Sub Form_Current()
On Error Resume Next
If Not IsNull(Me![txtimagepath]) Then
Me![myimagebox1].OLETypeAllowed = 1
Me![myimagebox1].SourceDoc = Me![txtimagepath]
Me![myimagebox1].Action = 0
End If
End Sub
Private Sub txtimagepath_AfterUpdate()
On Error Resume Next
Me![myimagebox1].OLETypeAllowed = 1
Me![myimagebox1].SourceDoc = Me![txtimagepath]
Me![myimagebox1].Action = 0
End Sub
Now it works fine when image path is available. But when there is no image path in text box, the unbound object frame still displays the last image. When navigating the records it will keep on showing that one image for all next records till there is another image path available.
How can this be solved so that it only shows the image for that record where the image path is mentioned.
Thanks