Results 1 to 4 of 4
  1. #1
    takara is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    9

    Get data from Multiple Items Form Row on click

    I have a multiple Items Form that is filtered on load to show line items for an order. (user types in order #, multiple items form shows only the lines for that order)... this is working fine.



    Once the form loads, it might show 4 lines.

    How can I capture the data from that row when the user clicks the row (anywhere or any field in the row... it's ok if the user has to press a button on that row)

    once I capture the data I can manipulate it fine, just can't figure out how to capture the data..

    for now it'd be fine to show data in msgbox to see I can capture it.

    e.g.
    msgbox = me.form.detail.rowUserClicked.fieldname (I know thats not code)

    If the user clicks row one, I want to capture the data from row 1 for example.

    Thanks in Advance.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    for
    when the user clicks the row (anywhere or any field in the row... i
    , use the form current event

    Private Sub Form_Current
    msgbox "A row has been clicked with this ID: " & ID
    end sub

    this assumes you have a control called ID - substitute ID with another control name if necessary

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I use the DblClick event of the form used as subform. Example:

    Private Sub Form_DblClick(Cancel As Integer)
    MsgBox Me!fieldname
    End Sub

    Otherwise, can use Click event of each control in the form or a button if in Single or Continuous view.

    Current event would work but will also fire when navigating to record by navigation buttons or otherwise with code, not just when clicked on.
    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
    takara is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    9
    wow, msgbox [line no_] works great thanks guys.. didn't think Access would automatically pass this so I didn't try. thanks again.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-19-2015, 02:11 PM
  2. prevent deselect items in the listbox after right click
    By masoud_sedighy in forum Programming
    Replies: 1
    Last Post: 08-13-2013, 01:06 AM
  3. multiple items form
    By eraengineer in forum Forms
    Replies: 1
    Last Post: 04-17-2013, 03:33 PM
  4. Multiple Items Form - Interaction btw Fields
    By Douglasrac in forum Forms
    Replies: 15
    Last Post: 03-25-2011, 09:31 AM
  5. On click menu items do not work
    By mrk68 in forum Access
    Replies: 1
    Last Post: 03-23-2009, 07:29 PM

Tags for this Thread

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