Results 1 to 8 of 8
  1. #1
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125

    External File Pointing Problem

    My current problem is pointing Form “Beginner Pictures” to the correct external folder “Beginner_Pics”. My previous endeavor with Form “Gallery”retrieves Photos from external folder “Gallery_Pics”. I developed both Forms ComboBox using DataPigTechnologies instructive video. The following areas were reviewed for errant code:
    Form “Beginner Pictures” Property Sheet, Property Source contains the desired “Beginners Carving Query”
    ComboBox "BcNr_Select" Property Sheet: (1) AfterUpdate entry contains all new fieldnames except for Table Fields and the logic is similar to the working "Gallery" Form. It also has the changed code for the FileNmBld = "Beginner_Pics\" & JPEG_Id & ".jpg" (2) RowSource contains: SELECT [CarvingTable].IDCarv, [Carving Table].CarvingNR FROM [Carving Table] WHERE ((([CarvingTable].IDCarv) Like [Forms]![Beginner Pictures].[BcNr_Select] &"*")) ORDER BY [CarvingNR];
    Yet the comboBox displays the values for “Gallery_Pics” instead of “Beginner_Pics”. Where else should I look for errant/missing code? TIA Phil

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Show the code for the AfterUpdate event.

    Want to provide db for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    Here is the AfterUpdate Event code: Private Sub BcNr_Select_AfterUpdate()
    Me.Requery
    Dim Ver As String
    Ver = 1
    Call BEG_JPEG_Display
    End Sub
    Private Sub BEG_JPEG_Display()
    ' Procedure executed through Calls Select_BCnR_AfterUpdate
    On Error GoTo Err_BEG_JPEG_Display
    Dim Beg_Filename As String
    Dim Beg_Pathname As String
    Dim File_Path As String
    Dim FileNmBld As String
    Dim Sr_Message As String
    Sr_Message = "Beg_JPEG_Display entered"
    ' Fetch the relative bath for DBM
    Beg_Pathname = CurrentProject.Path
    ' Pictures will be in folder Beginner_Pics"
    ' to construct file name
    ' file name format is BcNr001v1.jpg for Beginners samples
    ' Determine Select_Nr range: units, tens or hundreds
    FileNmBld = "Beginner_Pics\" & JPEG_Id & ".jpg"
    ' Build full file path
    Beg_Filename = Beg_Pathname & "\" & FileNmBld
    File_Path = Beg_Filename
    Me.ImgStock.Picture = Beg_Filename
    On Error GoTo Err_BEG_JPEG_Display
    Sr_Message = File_Path
    If Dir(Beg_Filename) = "" Then
    ' Display the "no picture exist for this carving" message picture
    FileNmBld = "Beginner_Pics\" & "BCnR963v1" & ".jpg"
    Beg_Filename = Beg_Pathname & "\" & FileNmBld
    Me.ImgStock.Picture = Beg_Filename
    End If

    GoTo Exit_BEG_JPEG_Display

    Err_BEG_JPEG_Display:
    FileNmBld = "Beginner_Pics\" & "BCnR963v1" & ".jpg"
    Beg_Filename = Beg_Pathname & "\" & FileNmBld
    Me.ImgStock.Picture = Beg_Filename
    Sr_Message = "Picture not on File"
    ' Clear_Screen
    ' Resume Exit_BEG_JPEG_Display
    Exit_BEG_JPEG_Display:
    End Sub It appears to me that this code isn't being reached! It act as though there is a link to the other external file and code. The DBM has 7 forms, 4 tables,10 Queries and 2 external picture folders. I will need to see if I can compress the it to a subset of the original. TIA for taking interest in my problem.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    What is ImgStock? Is this an Image control? It must be since you are trying to set the Picture property. Why not setting the ControlSource property instead of Picture property? I don't understand why using AfterUpdate event anyway. The ControlSource of Image control can call a function that constructs the path string.

    You have [Event Procedure] in the AfterUpdate event property?

    Have you step debugged? Follow code as it executes. Do variables get set as expected? Where does code deviate from expectations?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    ImgStock is the box where the pictures are displayed. It works because I am experiencing "not found message pictures" there. The AfterUpdate event is triggered after a carving number is selected from the ComboBox. I have placed Sr_message displays at the beginning of Private Sub BEG_JPEG_Display(), they do not get triggered. Execution doesn't go far enough to use Step debugging or I don't know where to start. When I execute the "Beginners carving Query" by itself, it displays the wrong folder Pics. Is there a way to tie a query to a specific external file? Could this form be influenced by code associated with other Forms because both Gallery and Beginner Picture Forms use the same Table relationships, field names, etc? TIA Phil

  6. #6
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    I just noticed that the Property Sheet for "ImgStock" has " C:\Users\Philip\Documents\Access Data Bases\Development\Beginner_Pics\BCnR963v1.jpg" coded in the"Picture" field and it is the one being displayed. TIA Phil

  7. #7
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    I tried to change the entry to "none" like the Gallery Property sheet, however the Switchboard won't let me! I succeeded in deleting the entry and Access coded the none. No change in performance. TIA Phil

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    "tie a query to a specific external file" - as in a jpeg? Not really sure what this question is getting at. The query can have a field that has a file path/name.

    Code to set Picture property was method required before Access 2007. Here is link http://support.microsoft.com/default...%2Dus%3B285820 to sample code for setting the Picture property. The ControlSource property was introduced to the Image control with Access 2007 to easily allow dynamic display of images with records and code is not required.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Image display in reports from external file
    By lumoco in forum Reports
    Replies: 2
    Last Post: 09-28-2011, 04:37 PM
  2. How to select from MDB file through external tools
    By ryanlcs in forum Programming
    Replies: 1
    Last Post: 08-10-2011, 11:31 AM
  3. Exporting Attachments to an external file
    By springa in forum Import/Export Data
    Replies: 3
    Last Post: 07-17-2011, 05:33 AM
  4. Browse to external file while in a form
    By michaeljohnh in forum Import/Export Data
    Replies: 9
    Last Post: 09-22-2010, 09:33 AM
  5. Problem - Objects Pointing to Table Copy
    By Linda in forum Access
    Replies: 1
    Last Post: 03-22-2010, 10:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums