Results 1 to 10 of 10
  1. #1
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31

    image linking from records with varying quantities

    I have included some of what I have if it helps make sense. I want to have links to the records in the images tab if there are records in the field.

    I am trying to figure out what would be the best method for using hyperlinks to image files/aerial photo links. I have a database with several hundred buildings in the city that we keep information on and update the floorplans on. Some records have more data files than others.


    i.e. For building A I have a link to an aerial photo in column j, pdf image in column k, pdf image in column m, and nothing in columns n-q
    Where as building B has links to files in j-q, and building C has only links to files in j&k and l-q are empty.

    I am trying to figure out the best way to show the options and let these be selected on form. I tried a combo box, but it shows the whole record (8 columns) and multiple records. I dont know if a button would work, or how the combo box would work with null records

    Hopefully this makes sense to everyone and any help would be greatly appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why are you using letters to reference table fields? This is not Excel spreadsheet. Use field names. The table has 14 fields. Apprently q (17th letter of the alphabet) refers to the field [PFP Drawing7]. Why did your letter assignments skip a-i?

    What will you do if you have more than 7 PFP Drawings? Although this is not normalized data structure, it might be workable for your situation.

    If you just want to be able to click hyperlink and open the file, simply use a textbox bound to each 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.

  3. #3
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I was initially doing a text box referencing the fields like you suggested, but I don't want to have 8 or 9 boxes show if there is no data. I could try making the box invisible if the field is null, that may possibly work.

    As for using letters, it was just me being lazy, I didn't want to type out the whole field name.

    One of the things I was wanting to try and do (This is really more of a learning project for me than anything which is helping me learn some of the features/coding) is have a bound frame that would show a preview of the file (which when clicked would open the file) with possibly a button to go to the next/previous record and repeat until all fields with data are viewed (some records may be 3 images, some may be 10 images)

    Thanks for the help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Yes, code could be used to make controls invisible if no value in field.

    I don't think Access can 'preview' pdf files. The image control can display jpg, png, bmp. Also, your aerial image links are to a web page, which I tried to open but couldn't.
    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
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I didnt have the actual link, so made up a website.
    As for the preview, If I was able to save them as a jpg would that be a possible option. I was hoping for something that would have a preview box (bound object) in the middle of the last tabbed box with a botton on either side: forward and backwards. Then having the buttons navigate through the fields as long as there is data in the image file fields. I think that this is going to be alot more complicated than I am anticipating, but would like to try messing with it...any suggestions?

  6. #6
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I have been working on getting the text boxes to hide if there is no data, and tried a few ways with no success. Here are a few ways Ive tried.

    (note: I have the visibility set to "no" in the properties for each text box)

    Attempt #1
    ------------------------------------------------------------
    private sub aeriallink beforeupdate (cancel as integer)

    Me.<formtextbox>.Visible = Not(IsNull(Me.<tabledatafield>))
    Me.<formlabelbox>.Visible = Not(IsNull(Me.<tabledatafield>))

    end sub
    ------------------------------------------------------------

    Attempt #2
    ------------------------------------------------------------
    private sub aeriallink beforeupdate (cancel as integer)

    If Me.<tabledatafield> <> Null Then Me.<formtextbox>.Visible = True Else me.<formtextbox>.Visible = False

    end sub
    ------------------------------------------------------------

    Attempt #3
    ------------------------------------------------------------
    private sub aeriallink beforeupdate (cancel as integer)

    Me.<formtextbox>.Visible = False IsNull(Me!<formtextbox>)

    end sub
    ------------------------------------------------------------

    I dont know if I am putting these events in the wrong locations, if I am writing the code wrong, need to turn visibility back to yes in properties of text box, or a combo of all. Most of my code is written in the style of option 2, so if possible I would like to keep it uniform, but would like to know if there are other ways to "skin a cat"

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You are not really using <> in actual code? What is aeriallink control? You might try the OnCurrent event of form.

    Me.textbox.Visible = Not IsNull(Me!fieldname)
    or
    If Not IsNull(Me!fieldname) Then Me.textbox.Visible = True

    The Image control is intended to display images. With Access2007, the image control has a Control Source property. The control can be bound to a field of table that stores path to image.
    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.

  8. #8
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    No, Im not actually using the <> in the code, just showing what was referenced. Ive tried both ways you showed (using the field name of the text box and field name), but Its still not functioning properly. Ive tried to turn on visibility, turn it off, putting the code in the "on enter" and "after update" as well as "before update" event sequence of the text box.
    Any other thoughts, or am I just entering it incorrectly.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You do not want these controls available to user to enter data, just display? Did you try the OnCurrent event as suggested? I tested it and that works.

    What do you mean by 'not properly'? What happens - error message, wrong result, nothing?
    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.

  10. #10
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    Finally got it to work, I was looking at the wrong event sequence. Thanks!!

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

Similar Threads

  1. Linking records
    By Joe_A in forum Database Design
    Replies: 3
    Last Post: 11-04-2011, 12:36 PM
  2. Get Varying Query Columns into Report
    By Elios in forum Reports
    Replies: 1
    Last Post: 05-05-2011, 03:16 AM
  3. Replies: 0
    Last Post: 10-18-2009, 10:44 AM
  4. Linking Records
    By timryder in forum Access
    Replies: 6
    Last Post: 09-08-2008, 04:00 PM
  5. Linking Multiple records
    By rricci@marcct.org in forum Programming
    Replies: 0
    Last Post: 02-14-2008, 09:18 AM

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