Results 1 to 5 of 5
  1. #1
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36

    Text box bound to combo box

    I'm doing something wrong and I can't see what it is..

    I have a simple table that is supposed to track payment $ & dates for companies.

    so i have a table with a bunch of columns (company, payment 1, payment 1 date, payment 2, payment 2 date..).

    on the form I have a combo box:

    SELECT [Payments].[ID], [Payments].[Company Name] FROM Payments ORDER BY [Company Name];

    then I set my textbox' row source to: =combo7.column(x)

    0 = 1st column in table


    1 = 2nd column in table

    only 0 and 1 works. If I try 3, 4 and so on it does not pull the information. What am I doing wrong?

    the goal of this is that you select the company name from your combo box and the associated payment information is displayed or can be entered.

    thanks for the help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Is this combobox unbound? Is purpose of form to enter payments? Show form's RecordSource SQL statement.

    The combobox has only 2 columns (ID and Name). There is no column 3, 4 or so on to reference.

    Multiple similar named fields (Payment1, Payment2) indicates data is not normalized. Company is limited to 2 payments?
    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.

  3. #3
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36
    Oh I see.. I misunderstood how this works. I though that it was refering to column in my table, not the combobox. got it now

    Here is what I'm trying to do:

    I have a table with company name and a bunch of columns for payments. the form is ment to keep track of actual payments versus what it should've been by contract.

    What I want to do is that you have a drop down box that gives you all company names to select from and once you selected a company the other fields display the information related to that company.

    attached a simplified version of what i wanna do .. table and form.
    so if you select company A in the drop down i want date 1 to be shown as 01/01/12 and amount1 $1. if you select company B it has to change to date 03/03/12 and $3

    Hope that made any sense

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What is a 'bunch' of columns (how many, you show 2 payment columns)?

    Several ways to do this. You can include the payment columns in the combobox (hidden by setting 0 width) then refer to the appropriate column in the textbox ControlSource.

    Or check this tutorial http://datapigtechnologies.com/flash...tomfilter.html

    Or use DLookup function. Domain aggregate functions can be slow. Use on forms and reports only if absolutely have to.
    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.

  5. #5
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36
    Quote Originally Posted by June7 View Post
    That tutorial is awesome and helped me tons. Thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. filter report via bound text box
    By JeremyPSU in forum Reports
    Replies: 2
    Last Post: 11-04-2010, 11:03 AM
  2. Concatenating (2x unbound into bound text box)
    By justinwright in forum Programming
    Replies: 1
    Last Post: 08-19-2010, 08:11 AM
  3. How to bound a text box
    By bundy75 in forum Forms
    Replies: 10
    Last Post: 07-30-2010, 02:50 PM
  4. Bound a unbound text box to the table
    By Brian62 in forum Forms
    Replies: 1
    Last Post: 11-06-2009, 11:05 AM
  5. I can't enter text in a bound text box
    By Jerry8989 in forum Forms
    Replies: 3
    Last Post: 10-05-2009, 11:52 AM

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