Results 1 to 4 of 4
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Double Clicking a List Box

    I have a form [frmRptOfficerReport] with a list box [lstInvolvedPersons]. I want to double click the record on the list box and open a form where the second column equals the field in the form. I can't remember how to do that. This is what I tried, which just brought up the debugger:



    Private Sub lstInvolvedPersons_DblClick(Cancel As Integer)
    DoCmd.OpenForm "frmRptSubjectORAdd", , , "[SubjectID]=" & Forms!frmRptOfficerReport!lstInvolvedPersons.Colum n(1)

    End Sub

  2. #2
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    That put a space in it. Here it is:
    DoCmd.OpenForm "frmRptSubjectORAdd", , , "[SubjectID]=" & Forms!frmRptOfficerReport!lstInvolvedPersons.Colum n(1)

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    SubjectID is a number type? Why is it in the second column? What is in first column?

    Could use shorthand Me.

    DoCmd.OpenForm "frmRptSubjectORAdd", , , "[SubjectID]=" & Me.lstInvolvedPersons.Column(1)

    Forum inserting space is a 'feature', can't edit it out. Ignore it.
    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.

  4. #4
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Yes. It is a number type. I had the [ReportID] as the first column. The Me. worked. Thanks.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-03-2015, 08:24 AM
  2. Replies: 3
    Last Post: 07-15-2015, 03:14 AM
  3. Replies: 4
    Last Post: 09-02-2014, 03:53 PM
  4. Replies: 6
    Last Post: 04-26-2013, 10:07 AM
  5. Replies: 2
    Last Post: 02-13-2013, 04:14 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