Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    hinsdale1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Apr 2013
    Posts
    63
    Okay already come to my next hurdle: nevermind.. think i have figured it out.. and if not i probably should post in a new thread anyway.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What do you mean by 'take me to their record'? Hyperlinks open files or web pages, not a record in a table. If you want to open another form to display the image record, that is like:

    DoCmd.OpenForm "formname", , , "ImageLocation='" & Me.Imagecontrolname.Picture & "'"

    If you want to move to the record on the form frmQuery11, that is another matter. Options:

    1. filter the form

    2. use recordsetclone to find the bookmark, example from my project
    Private Sub cbxCommunities_AfterUpdate()
    'Find the record that matches the control.
    Me.RecordsetClone.FindFirst "Community = '" & Me.cbxCommunities & "'"
    If Not Me.RecordsetClone.EOF Then Me.Bookmark = Me.RecordsetClone.Bookmark
    End Sub

    Real trick is figuring out what event to use. Maybe the Image control Click or DblClick.
    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. #18
    hinsdale1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Apr 2013
    Posts
    63
    Thanks for your ideas June7, very illuminating as usual. I didn't get to work on it or test much but my idea was to just add a line for a new variable (txtLinkToID1, txtLinkToID2, etc) to the While/Wend loop you helped me create to temp hold the ID numbers of each of the "related" outfits that DAO.recordset select statement is locating:

    SQL = "SELECT tblOutfits.[ID], tblOutfits.[Relationship], tblImage.[txtImageName] FROM tblImage INNER JOIN tblOutfits ON tblImage.ID = tblOutfits.Image WHERE ((tblOutfits.[Relationship])=" & Me.[relationship] & ");"
    Set RS = CurrentDb.OpenRecordset(SQL)
    i = 1
    While Not RS.EOF
    If RS("ID") <> Me.ID Then
    Me("Image" & i).Picture = RS("txtImageName")
    Me("Image" & i).Visible = True
    Me("txtLinkToID" & i) = RS("ID")
    i = i + 1
    End If
    RS.MoveNext
    Wend
    RS.Close
    Set RS = Nothing


    And then use them for the event procedure subs for each of the images (image1,image2, etc) activated on click:

    If (txtLinkToID1 & vbNullString) = vbNullString Then Exit Sub
    Dim RS As DAO.Recordset
    Set RS = Me.RecordsetClone
    RS.FindFirst "[ID]=" & txtLinkToID1
    If RS.NoMatch Then
    MsgBox "Sorry.", _
    vbOKOnly + vbInformation
    Else
    Me.Recordset.Bookmark = RS.Bookmark
    End If


    I created some "non-visible" texts box (txtLinkToID1, txtLinkToID2, etc) on my form layout to receive the new variables and then use them to hold the value until needed with an event procedure activated by Click on the image:

    I dont think creating dummy text boxes to store the txtLinkToID(i) variables is the best method but I dont know how else to do it. Any more efficient coding is welcome!

    (my coding knowledge is severely lacking)

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Code should be able to pull string back from the Picture property but the textboxes with ID should work just as well.
    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. #20
    hinsdale1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Apr 2013
    Posts
    63
    Muchas gracias.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo boxes on form not populating table
    By Madraykin in forum Access
    Replies: 12
    Last Post: 03-09-2012, 10:34 AM
  2. Replies: 1
    Last Post: 10-28-2011, 01:57 PM
  3. Replies: 7
    Last Post: 09-06-2011, 08:00 PM
  4. Replies: 17
    Last Post: 08-19-2011, 01:19 PM
  5. Incorrect Values Populating My Combo Boxes
    By charlyzaingel in forum Forms
    Replies: 19
    Last Post: 06-23-2011, 10:17 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