If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Image Control on Report - Error 2100 - HELP!
I need to have an external (linked) image on a report. I have
attempted to use the same code I use in the same DB's forms. The code on the form(s) is called from OnCurrent and works flawlessly. I am able to see the images on the report but not before I have to click through the 2100 error. The code works the same from the header group and the details section "On Format" sub. Does anyone know how to bypass/ignore this error or apply my code correctly? Here's the code I am using along w/ Lebans: http://www.lebans.com/loadjpeggif.htm ================================================== === Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Err.Number = 2100 Then MsgBox "error" Exit Sub End If On Error GoTo Eignore Dim sPath As String If IsNull(PicFileName) Or PicFileName = "" Then If Len(Dir(Me![PicPath])) 0 Then sPath = PicPath fLoadPicture Me.Image1, sPath, True Else 'MsgBox "missing image" sPath = txtPath & "NoImageOnFile.jpg" fLoadPicture Me.Image1, sPath, True End If End If ScrollToHome Me.Image1 Eigno If Err.Number = 2100 Then MsgBox "error" Resume End If End Sub ================================================== ======= Thanks! Bob |
#2
|
|||
|
|||
Image Control on Report - Error 2100 - HELP!
You do realize the code you are using is meant for Runtime only installs of
Access. Anyhow, you need to remove the line of code that forces the ScrollBar to return to its Home position of 0,0. THis is obviously not possible on a report and is meant for when the Image control is on form being used as a SubForm as in the sample project. ScrollToHome Me.Image1 -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. wrote in message oups.com... I need to have an external (linked) image on a report. I have attempted to use the same code I use in the same DB's forms. The code on the form(s) is called from OnCurrent and works flawlessly. I am able to see the images on the report but not before I have to click through the 2100 error. The code works the same from the header group and the details section "On Format" sub. Does anyone know how to bypass/ignore this error or apply my code correctly? Here's the code I am using along w/ Lebans: http://www.lebans.com/loadjpeggif.htm ================================================== === Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Err.Number = 2100 Then MsgBox "error" Exit Sub End If On Error GoTo Eignore Dim sPath As String If IsNull(PicFileName) Or PicFileName = "" Then If Len(Dir(Me![PicPath])) 0 Then sPath = PicPath fLoadPicture Me.Image1, sPath, True Else 'MsgBox "missing image" sPath = txtPath & "NoImageOnFile.jpg" fLoadPicture Me.Image1, sPath, True End If End If ScrollToHome Me.Image1 Eigno If Err.Number = 2100 Then MsgBox "error" Resume End If End Sub ================================================== ======= Thanks! Bob |
#3
|
|||
|
|||
Image Control on Report - Error 2100 - HELP!
Your code seems to work better (and faster w/out the progress bar) than
the standard Image code I was using. Are there issues I should be aware of by not using this in a runtime version? Anyway, I removed the line and still got the error (probably b/c of the "ScrollToHome" code in the mod). So, I went back to the "Image.Picture = path" and it works fine. I am OK w/ the progress bar coming up while it formats the report but it was unacceptable (to me) for the OnCurrent of a form. Thanks for your help Stephen! |
#4
|
|||
|
|||
Image Control on Report - Error 2100 - HELP!
There is no need for my code in non Runtime only installs unless you are
working with older versions of Access and very large Images. There are no negative issues to using the code with any version of Access. The one thing you must do is turn of the Loading Image dialog. If you don't, and quickly scroll through the records in Form view, or page quickly in Print Preview, you run the risk of crashing Access. Use the Registry mod at the Access MVP site: Additionally, two issues in regards to the Registry modification pointed to here http://www.mvps.org/access/api/api0038.htm 1) The Registry key MUST be "No" NOT "no" or "NO" 2) On systems with XP or on systems with more than one user account, you must add/modify the key in both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE. -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. "Bob" wrote in message oups.com... Your code seems to work better (and faster w/out the progress bar) than the standard Image code I was using. Are there issues I should be aware of by not using this in a runtime version? Anyway, I removed the line and still got the error (probably b/c of the "ScrollToHome" code in the mod). So, I went back to the "Image.Picture = path" and it works fine. I am OK w/ the progress bar coming up while it formats the report but it was unacceptable (to me) for the OnCurrent of a form. Thanks for your help Stephen! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parameter thru Form Dialog Box for REPORT | Sandy | Setting Up & Running Reports | 16 | January 10th, 2006 10:06 AM |
Linking v Embedded | Jim Bunton | General Discussion | 5 | August 10th, 2005 11:09 PM |
Attn: Ken Snell - Displaying chemical structures in Access | Michele | General Discussion | 11 | May 13th, 2005 07:19 PM |
Image Control Access 2002 | Tom | General Discussion | 8 | December 8th, 2004 08:11 AM |
Access Calendar | lost | General Discussion | 2 | July 7th, 2004 04:58 AM |