Results 1 to 9 of 9

Thread: combobox

  1. #1
    Join Date
    Jan 2010
    Posts
    32

    Unanswered: combobox

    I have a combo box ("severity")that uses a value list as it's row source type. The
    options in it are 1, 2, 3, or 4. I want have one of these items to
    automatically populate this combobox depending on what is selected in a box
    called "Comments".

    The "Comments" combobox is based on a query with a SQL of: SELECT tblComments.
    Comments, tblComments.CmntAreaCode, tblComments.CommentID FROM tblComments
    WHERE (((tblComments.CmntAreaCode)=Forms!frmObservations !frmLO_Details.Form!
    CmntAreaCode)) ORDER BY tblComments.CmntAreaCode;

    My tblcomments looks like this:


    commentID comment otherstuff Severity
    1................blahblah...................2
    2.................blahblah..................1
    3.................blahblah..................3

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    you do not need a combobox for Severity if the Severity value is in the Comments combox's underlying record source.

    instead put an unbound text box Severity on the form and set its source to be:
    =me.CommentComboBoxName.column(2)

    am guess at the column being two as the column count begins at 0 if pre Access 07; obviously modify as appropriate to your actual syntax....but this will work - whenever someone changes the Comment choice in that combobox the value in the Severity text box will change too....

  3. #3
    Join Date
    Jan 2010
    Posts
    32
    I think we are closer.

    The "Severity" box has the #name? thing in it.

  4. #4
    Join Date
    Oct 2009
    Posts
    340
    #name indicates that it can not find the control that you have referenced; maybe a syntax error, mispelling, etc.

  5. #5
    Join Date
    Jan 2010
    Posts
    32
    I have rechecked evrything...I can't get rid of the #name. Ive got
    =[me].[ObComment].[column](2) in the Severity text box and the comments combo box is named "obcomment".

  6. #6
    Join Date
    Oct 2009
    Posts
    340
    your bracket - parenthesis don't look correct...try:
    =[me].[ObComment].column(2)

    could be in your version 2007 the column count begins with 1, not 0, so it would be column 3

  7. #7
    Join Date
    Jan 2010
    Posts
    32
    I have Access 2003.

    Let me back up. Is the [column] referring to the column that "Comments" shows up in the table the subform is based on? Or the query the Comments combo box is based on?

  8. #8
    Join Date
    Oct 2009
    Posts
    340
    referring to Comments Combobox; as your original post displayed that this source has the severity value

  9. #9
    Join Date
    Jan 2010
    Posts
    32
    Ok....the "comments" combobox is based on a query. the query has 3 columns. "Comments", "CmntAreaCode", and "CommentID". I have changed the column anywhere from 0-3. I still get the #name?.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •