Results 1 to 6 of 6
  1. #1
    schwabe is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Location
    San Francisco Bay Area
    Posts
    50

    Tetbox text depending on a combobox.

    I have a form using a combobox for letting the user choose a project and to each project a customer is assigned. Now, I'd like to display the customers name after a project is chosen. How do I do this?



    Thanks.

  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
    Does this fit the situation?

    BaldyWeb - Autofill
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    schwabe is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Location
    San Francisco Bay Area
    Posts
    50

    Thumbs up

    Thanks, Paul!

    I've tried that. However, I get a runtime error now saying: "You can't assign a value to this object!".

    This problem dissapears, when I remove the Control source of the textbox.

    I might mention, that the project is already a cascaded popup box, thus I have

    Private Sub cboOEM_AfterUpdate()

    Dim strProj As String

    cboProject = Null
    txtODM = Null

    strProj = "SELECT DISTINCT qryProjectOpen.txtProjectName, qryProjectOpen.txtODMName FROM qryProjectOpen "
    strProj = strProj & " WHERE qryProjectOpen.lnkOEM = cboOEM.value"
    strProj = strProj & " ORDER BY qryProjectOpen.txtProjectName;"

    cboProject.RowSource = strProj
    End Sub

    What am I doing wrong here?

    Benjamin

  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
    You get an error here?

    txtODM = Null

    If so, the control source of that textbox would need to be a field name, not:

    =ComboName.Column(x)

    You want one method or the other, not both.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    schwabe is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Location
    San Francisco Bay Area
    Posts
    50
    Thanks again, Paul!

    That solved the problem.

  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
    No problemo!
    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. Displaying text in combobox
    By tylerg11 in forum Forms
    Replies: 9
    Last Post: 01-19-2012, 11:51 AM
  2. show subform depending on combobox
    By d_Rana_b in forum Programming
    Replies: 2
    Last Post: 03-15-2011, 05:09 AM
  3. Changing calculation depending on Combobox
    By GraemeG in forum Programming
    Replies: 29
    Last Post: 02-15-2011, 11:33 AM
  4. change a combobox value depending on another
    By emadaldin in forum Access
    Replies: 3
    Last Post: 01-17-2011, 01:06 PM
  5. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 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