Results 1 to 8 of 8
  1. #1
    alextol is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    21

    How to connect textbox to a query

    I have a form with the texbox, combobox and RunReport command button. I also have a query: ClientInfo. I want to enter client ID into Combobox, click Run Report button and have my textbox populated with the Client's Name. How do I connect textbox to a query and Run Report button? Can someone please help?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    This would be more efficient:

    http://www.baldyweb.com/Autofill.htm

    your way would require a DLookup() or opening a recordset.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    alextol is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    21
    1) If I used your way, how do I connect Combo box to the query? I tried opening (and typing in name of the query) in Combo box control source field. It didn't work. Its not availible in the drop down menu.

    2) If I used DLookup () method, where would I type in the DLookup formula? in the Event or Data Property section? and which line?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The query would probably be the row source of the combo. The DLookup() could be the control source of the textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    alextol is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    21
    Thanks Paul. I made it work your way, but for some reason two of my text boxes (they pull data from columns 9 and 10 in the query are not working. Is there a limit on how many textboxes one can outfill this way?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The "usual suspect" is the column count property of the combo not being set correctly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    alextol is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    21
    Thanks pbaldy! This was it. It works now!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 03-07-2013, 03:21 PM
  2. Copy textbox to textbox from query
    By zduffy in forum Programming
    Replies: 2
    Last Post: 11-08-2012, 02:36 PM
  3. Replies: 1
    Last Post: 10-28-2011, 02:46 PM
  4. Replies: 5
    Last Post: 03-29-2009, 07:20 AM
  5. Replies: 3
    Last Post: 04-05-2006, 04:17 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