Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box association (Access 2003)

    I know I have done this before, but I just cannot find it anywhere in my code logs.

    I have a lookup table tblReportNames - 3 columns - Title, Use, PROD_NONQUAN

    On my form I have a combobox cboReport whose source is column(0) of tblReportNames.
    I have a TextBox on the form called txtPROD.

    Based on what is selected from cboReport, I want the textbox to autofill in tblReportnames, column(2) (which is actually the third column.

    Can you help?

    Thank you very much !

    Michael Abrams

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box association (Access 2003)

    If the value of txtProd should be fixed (not editable), set its Control Source property to
    <code>
    =[cboReport].[Column](2)
    </code>
    If you want the user to be able to modify the value after it has been set, leave the Control Source of txtProd blank, and use code in the After Update event of cboReport:
    <code>
    Private Sub cboReport_AfterUpdate()
    Me.txtProd = Me.cboReport.Column(2)
    End Sub</code>

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box association (Access 2003)

    With that Row Source, the combo box will have only one column, so I don't understand what you want now.

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box association (Access 2003)

    I realize how important semantics is and being precise with descriptions. so I apologize.

    OK I am a little fuzzy today being on a bunch of cold meds....

    The combobox, cboReport, has a Rowsource of the following:
    SELECT tblReportNames.[REPORT HEADER/TITLE] FROM tblReportNames ORDER BY tblReportNames.[REPORT HEADER/TITLE];

    User selects a report name using the combo box.

    I want my textbox to autofill from tblReportnames, column(2) based on the selection from cboReport


    (edited to possibly clear up any confusion)

    Thank you so much !

    Michael

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box association (Access 2003)

    So I need to use all 3 columns in the combobox, and hide columns (1), and (2).

    How do I code for column(2) in the text box?

  6. #6
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box association (Access 2003)

    got it.

    Your original answer, of course.

    Thank you !!

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box association (Access 2003)

    <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>

Posting Permissions

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