Results 1 to 6 of 6
  1. #1
    mikehorse is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    9

    Populate texbox with contactenation of dropdown combo boxes

    Hi All.



    This is my very first post to this forum... hope first impressions not too negatively affected

    I'm very new to access2010 and databases. I'm trying to build a database that will help manage / track tests.

    I have created my tables & relationships and a form called testcases, this is used to assign a "test" to a "testcycle" & "project" (data for these are stored in the test, testcycle & project tables respectively). So, on the form are combo boxes where I select the test, test cycle & project and a text box for a testcase name. My problem is; I would like the name to be a concatenation of these selected fields. however when I use this function in the "control source" of the textbox

    =[Forms]![frmTESTCASE]![txtTEST_ID] & "-" & [Forms]![frmTESTCASE]![txtTESTCYCLE_ID] & "-" & [Forms]![frmTESTCASE]![txtTEST_PROJECT_ID].
    The form displays the foreign key values e.g. 1-2-3 and not the required names.

    Can anyone suggest how to resolve this. ? Thanks in advance.

  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
    If those are combos with the text in another column, use the Column property:

    [Forms]![frmTESTCASE]![txtTEST_ID].Column(1)

    The column property is zero based, so 1 is the second column of the row source.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Try something like:
    [Forms]![frmTESTCASE]![txtTEST_ID].Column(1).......
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    mikehorse is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    9
    Thanks Bob, that resolved the problem.

    However, for some reason the text in the testcase name, even though correctly displayed on the form is not being updated to the corresponding field in the table ?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Are you wanting to save the concatenated value? Why? Saving calculated data is usually a bad idea. Calculate the value when needed.

    Requires code in some event to save calculated data.
    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.

  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,652
    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: 2
    Last Post: 07-16-2014, 10:32 AM
  2. Replies: 5
    Last Post: 03-07-2012, 12:57 PM
  3. Replies: 3
    Last Post: 10-01-2011, 02:21 PM
  4. Replies: 0
    Last Post: 12-02-2010, 11:59 AM
  5. populate boxes based on combo box choice
    By Mattm1958 in forum Forms
    Replies: 13
    Last Post: 08-30-2010, 02:09 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