Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23

    Base Path

    Can anyone please help??

    Public Const BASE_PATH As String = "C:\Fog Line Data\Scan Documents" '<--- I need this BASE_PATH to find this value in a table field

    'I have a table field ScanLocation with the value C:\Fog Line Data\Scan Documents




    Thank you for any help..

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Not sure what you need help with.

    You want to find record(s) with that string in ScanLocation field? Build query.

    SELECT * FROM tablename WHERE ScanLocation="C:\Fog Line Data\Scan Documents";
    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
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    Thank you June7 for your reply..
    Here is the full code:
    I have a form that will show a picture of a JPG file for each record
    and the pictures are located in the "C:\Fog Line Data\Scan Documents" folder.
    This code here does work like it is, But what I want it to do is for the BASE_PATH code is to find
    that location "C:\Fog Line Data\Scan Documents" from a table field so if I ever had to move the
    Scan Document folder to a new location I would not have to redo the code, all I would have to
    do is change the location in the data table.

    Public Const BASE_PATH As String = "C:\Fog Line Data\Scan Documents"

    Public Function ChooseFile() As String
    Dim strFilter As String
    strFilter = ahtAddFilterItem(strFilter, "JPEG Files (*.jpg, *.jpeg)", "*.jpg;*.jpeg")
    ChooseFile = ahtCommonFileOpenSave( _
    InitialDir:=BASE_PATH, _
    Filter:=strFilter, _
    OpenFile:=True, _
    DialogTitle:="Select Photo...", _
    Flags:=ahtOFN_FILEMUSTEXIST)
    End Function

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,734
    FogLine,

    Seems you have what you need. Hopefully you have the details for these custom functions:
    ahtAddFilterItem
    ahtCommonFileOpenSave

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Possibly no code needed.

    You have a table with a single record that has this base path?

    You have another table that has a field with image names?

    Build query that includes both tables (no JOIN clause) and use this as report RecordSource.

    ControlSource of Image control:

    =[Base field] & "\" & [Image field]
    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.

  6. #6
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    No I don't have what I need you didn't read it all..
    But what I want it to do is for the BASE_PATH code is to find
    that location "C:\Fog Line Data\Scan Documents" from a table field so if I ever had to move the
    Scan Document folder to a new location I would not have to redo the code, all I would have to
    do is change the location in the data table.

  7. #7
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    Quote Originally Posted by June7 View Post
    Possibly no code needed.

    You have a table with a single record that has this base path?

    You have another table that has a field with image names?

    Build query that includes both tables (no JOIN clause) and use this as report RecordSource.

    ControlSource of Image control:

    =[Base field] & "\" & [Image field]
    Ok but what if I move the folder "C:\Fog Line Data\Scan Documents" to a new location?
    I would have to redo the BASE_PATH code..

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    WAIT! Your profile shows Access 2003. Access 2003 Image control does not have ControlSource property. Have to use VBA code to dynamically display images.

    Change the code to do a DLookup on table.
    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.

  9. #9
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    Quote Originally Posted by June7 View Post
    WAIT! Your profile shows Access 2003. Access 2003 Image control does not have ControlSource property. Have to use VBA code to dynamically display images.

    Change the code to do a DLookup on table.
    I am using a " DBPix control " from www.ammara.com
    to display the image.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Never heard of it. But then I've never used any 3rd party controls.

    Still, use DLookup.
    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.

  11. #11
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    Quote Originally Posted by June7 View Post
    Never heard of it. But then I've never used any 3rd party controls.

    Still, use DLookup.
    Well the main thing I am trying to do is:

    Public Const BASE_PATH As String = "C:\Fog Line Data\Scan Documents" '<-- HERE where I hard code the location
    Is there any code that would look in a table field for that location??

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Apparently cannot set constant with DLookup (just tried).

    So instead of referencing a constant, the code would do the DLookup.

    InitialDir:=DLookup("[Base field]", "table name"), _
    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.

  13. #13
    Join Date
    Jul 2010
    Location
    GA.
    Posts
    23
    Than you for all your help, I have it working now....

    Public Function ChooseFile() As String
    Dim strFilter As String
    Dim BASE_PATH As String
    BASE_PATH = Me.Text6

    strFilter = ahtAddFilterItem(strFilter, "JPEG Files (*.jpg, *.jpeg)", "*.jpg;*.jpeg")
    ChooseFile = ahtCommonFileOpenSave( _
    InitialDir:=BASE_PATH, _
    Filter:=strFilter, _
    OpenFile:=True, _
    DialogTitle:="Select Photo...", _
    Flags:=ahtOFN_FILEMUSTEXIST)
    End Function

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

Similar Threads

  1. Replies: 4
    Last Post: 09-18-2014, 06:41 AM
  2. Replies: 6
    Last Post: 05-27-2014, 05:41 AM
  3. web base form
    By elmira in forum Forms
    Replies: 2
    Last Post: 12-17-2012, 10:24 PM
  4. Replies: 3
    Last Post: 11-24-2012, 08:56 AM
  5. converting base 32 to base 10?
    By brandonze in forum Access
    Replies: 13
    Last Post: 08-01-2011, 04:11 PM

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