Results 1 to 6 of 6
  1. #1
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123

    Use Data From combobox for multiple queries

    Overview

    cboFunctions: combobox Using A Query (Returns:FctnID,FctnDesc,GroupID)
    I have one query that Refers to Column 1(FctnID)


    I need to be able to Refer to Column 3(GroupID) for another Query

    How can I get the combobox info to work with both Queries?
    Please include any VBA code if any is needed

    thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Reference combobox and listbox columns by index value. Index begins with 0 so column3 is index 2:

    Forms!formname!comboboxname.Column(2)
    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
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123
    I tried to put this in my query and came up with this error
    undefined function 'Forms!Form1!cboFunction.Column' in expression
    Click image for larger version. 

Name:	error.jpg 
Views:	13 
Size:	14.9 KB 
ID:	14637

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Ooops! Now seem to remember reference to Column index does not work in query and testing gives me the same error.

    However, textbox ControlSource can reference Column index:

    = [cboFunction].[Column](2)

    Then have query refer to the textbox instead.

    I just don't use dynamic parameterized queries, I use VBA code to pass filter criteria to forms and reports.
    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. #5
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123
    Thanks Very Much, that worked
    I would love to use more VBA, but one step at a time.
    btw: how do I set this thread to "Solved"?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Thread Tools dropdown above first post.
    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. Help creating queries from combobox input
    By argsemapp in forum Forms
    Replies: 6
    Last Post: 11-25-2013, 05:09 PM
  2. Combining 2 queries into one for combobox
    By T_Tronix in forum Access
    Replies: 2
    Last Post: 11-21-2013, 10:16 AM
  3. Replies: 19
    Last Post: 08-01-2013, 10:47 AM
  4. Editing data from multiple queries
    By MHernan1 in forum Queries
    Replies: 2
    Last Post: 08-16-2012, 05:01 PM
  5. Multiple Queries With Same Type Of Data
    By thegooser in forum Access
    Replies: 4
    Last Post: 05-04-2012, 09:31 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