I have a piece of code that I'm using to display an image on a report based on a path saved to each record. the code is:
it's simple and it usually works great..... except when it doesnt. It seems like every few months the code crashes access and then never works again. When I debug, the part that is highlighted is:
The only way i've found to correct it is to delete the report and the module and copy them back in from a backup database. it has become a somewhat stressful ordeal as it always seems to come up at the least opportune times and I wondered if anyone had an idea on what could be causing this code to crash or suggestions for stabalizing my database to prevent this from happening again.
Thanks
Bruce
Code:
Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.ImagePath) Then
Me.ImgPic.Picture = "O:\Bellingham\Intranet\Production\Labels\No Label.bmp"
Else
Me.ImgPic.Picture = Me.ImagePath
End If
End Sub
it's simple and it usually works great..... except when it doesnt. It seems like every few months the code crashes access and then never works again. When I debug, the part that is highlighted is:
Code:
Me.ImgPic.Picture = Me.ImagePath
The only way i've found to correct it is to delete the report and the module and copy them back in from a backup database. it has become a somewhat stressful ordeal as it always seems to come up at the least opportune times and I wondered if anyone had an idea on what could be causing this code to crash or suggestions for stabalizing my database to prevent this from happening again.
Thanks
Bruce