Results 1 to 4 of 4
  1. #1
    Shamli is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2018
    Location
    California
    Posts
    142

    List box column values retrieval

    Hi


    I want to retrieve from a form's list box column 2 values into another form.

    I am trying this in the control source . its throwing " undefined functions error"

    Forms!FormName!lstbox.column(2)

    Please let me know what the error is.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,528
    In the form after update event, put the 2 values into text boxes (hidden or visible)
    then you can use the textboxes in queries.
    NOTE: in VB, columns start with zero:

    Code:
    lstBox_afterupdate()
       txtName = lstBox.column(1)   'actually col 2
       txtAddr = lstBox.column(2)
    end sub
    or use the FULL path to the form
    forms!myForm2.txtbox2 = me.txtAddr

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    As a control source, you'd need an = at the beginning.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Shamli is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2018
    Location
    California
    Posts
    142
    Thank you. let me try that and see.

    Quote Originally Posted by ranman256 View Post
    In the form after update event, put the 2 values into text boxes (hidden or visible)
    then you can use the textboxes in queries.
    NOTE: in VB, columns start with zero:

    Code:
    lstBox_afterupdate()
       txtName = lstBox.column(1)   'actually col 2
       txtAddr = lstBox.column(2)
    end sub
    or use the FULL path to the form
    forms!myForm2.txtbox2 = me.txtAddr

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

Similar Threads

  1. Market Data Retrieval
    By Grefcon901 in forum Access
    Replies: 16
    Last Post: 04-07-2016, 01:59 PM
  2. Replies: 2
    Last Post: 01-20-2016, 08:43 AM
  3. Replies: 4
    Last Post: 12-29-2015, 03:25 PM
  4. Replies: 14
    Last Post: 07-13-2015, 12:47 PM
  5. Replies: 1
    Last Post: 09-11-2014, 05:53 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