Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image display Error -2147417848(80010108) workaround 2

Status
Not open for further replies.

MoLaker

Programmer
Apr 30, 2004
521
US
I found a few prior threads where this error was reported, but no real workable solution. Please pardon me if I overlooked one.

Description of problem:
A form which displays a text field containing path information to a JPG image and an Image control on the form to display the JPG. In the OnCurrent event, the image control's Picture property is set to the image path from the text field. The Picture Type property is Linked. This works okay - displaying the image as you step thru the records by clicking the Navigation buttons or using PgUp/PgDn.

The problem occurs when stepping thru the records by clicking the Record Navigation buttons faster than the new image can be displayed. After a dozen or so records, the error occurs. The error seems not to be trapable.

The specific error is
Run-time error '-2147417848(80010108)';
Method 'Picture' of object '_image' failed
Possible Workaround:Tested with A2K on Win XP only
Remove the form's navigation buttons by setting the Navigation Buttons property to No. Add Record Navigation buttons to the menubar or create a custom menubar with Record Navigation buttons to allow navigating thru the records with a mouse.

Note: There may be a fix which can be done within the event that triggers the error, but I have yet to find one. So, if someone has a coding fix, I would love to see it. In the meantime, perhaps this workaround will help.
 
MoLaker, I was cruising the forums this morning and came across your posting. I had a form with a combobox where you could select an employee. There was also a button to just move to whoever the next employee was (without user having to click the dropdown and click on the next name). If you clicked that button too fast, the error you described occurred. Here's how I dealt with it:

Private Sub btnNextEmployee_Click()
cboPickEmployee.SetFocus ' Move focus to a different control
btnNextEmployee.Enabled = False ' Disable control that called this routine

' Insert code here to get the next record and its image.

btnNextEmployee.Enabled = True ' Re-enable this control
End Sub

N2Life
 
Thanks, N2Life. That fixes the problem for using command buttons for record navigation. I still have to remove the record navigation buttons at the bottom of the form, but that's not a big issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top