Results 1 to 5 of 5
  1. #1
    kersplash is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2019
    Posts
    3

    Open Database Form on Double-Click on record

    In my attached project, there is a form called frm_Partner.

    There is a subform in this form on the right hand side that drills down to a booking (Tracking Ref#) and reschedule (Reschedule#).

    I want to be able to double-click in the 'Reschedule #' field and bring up the form frm_Reschedules showing the record for the 'Reschedule #' AND 'Tracking Ref#' as this is the primary key.



    Cross-posted here - https://www.excelforum.com/access-ta...on-record.html
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I haven't downloaded file. What code have you tried? Something like:

    DoCmd.OpenForm "frm_Reschedules", , , "[Reschedule #] =" & Me.textboxname & " AND [Tracking Ref#] = " & Me.anothertextbox

    Are these fields number type?

    Strongly advise not to use spaces nor punctuation/special characters in naming convention.
    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
    kersplash is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2019
    Posts
    3
    Can't get the code until I get back to work tomorrow.

  4. #4
    kersplash is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Jun 2019
    Posts
    3
    This is the code I have in frm_Reschedules;

    Code:
    Private Sub Form_Activate()
    On Error GoTo Err_Form_Activate
        Me.Requery
        If IsLoaded("frm_Partner") Then
            If Forms![frm_Partner]![tbl_Bookings subform].Form.RecordsetClone.RecordCount > 0 Then
                DoCmd.FindRecord "[Tracking Ref#] = " & Forms![frm_Partner]![tbl_Bookings subform].Form![Tracking Ref#]
                'DoCmd.ApplyFilter , [Tracking Ref#] = 2
            End If
        End If
    
    
    Exit_Form_Activate:
        Exit Sub
    
    
    Err_Form_Activate:
        MsgBox Err.Description
        Resume Exit_Form_Activate
    End Sub

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    If you want to open a form then why don't you have code to do that instead of FindRecord?

    Private Sub Form_DblClick(Cancel As Integer)
    DoCmd.OpenForm "frm_Reschedules", , , "[Reschedule #]=" & Me.[Reschedule #] & " AND [Tracking Ref#]=" & Me.[Tracking Ref#]
    End Sub
    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. double click on a list to open record
    By mlrucci in forum Forms
    Replies: 3
    Last Post: 07-29-2018, 07:41 PM
  2. Replies: 6
    Last Post: 02-28-2017, 09:33 AM
  3. Replies: 8
    Last Post: 02-04-2016, 05:10 PM
  4. Replies: 2
    Last Post: 10-29-2014, 03:25 AM
  5. Replies: 10
    Last Post: 02-20-2012, 11:25 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