Results 1 to 4 of 4
  1. #1
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352

    populate text box based on cmb box

    I have the control source for the text box set as =[CmbName].Column(1) (it doesn't work as is):


    However, the data that the textbox should draw from is from a different table than the one the form is made for. I have a table "Product". In it, there is product names as the PK and a "target" (a number) as a second field. In the form I want the user to be able to select a product (cmb) and the 'target' text box to auto-fill with the correct target number that is found in the Product table [for the selected product]. However the form's record source is for another table.

    EDIT: I have also tried =[Combo20].[Products]![Target]
    And that does not do the trick either.

  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,652
    The first one should work. Make sure the column count property of the combo is at least 2. That assumes the row source includes that data.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    So i should keep the first bit, as the text boxes control source or as a default value?
    column count property of the combo is at least 2.
    in the properties section?

  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,652
    Yes, like this:

    BaldyWeb - Autofill

    Column Count is a property of the combo; it needs to be set to the number of fields in the row source.
    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: 7
    Last Post: 03-02-2014, 03:16 PM
  2. Populate a text box based on a combobox selection?
    By Richie27 in forum Programming
    Replies: 4
    Last Post: 04-25-2012, 08:00 AM
  3. Replies: 5
    Last Post: 03-07-2012, 12:57 PM
  4. How to populate text box based on Combo Box
    By maxstead in forum Forms
    Replies: 3
    Last Post: 09-08-2011, 01:25 PM
  5. Replies: 8
    Last Post: 05-17-2011, 04:41 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