Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Boxs Lookup (2002)

    I have a row of fields: AccountNumber, cboAccount, cboCompany, and cboContact.
    I want to select cboAccount and select an account i.e Technician Expense and pull up all the Technician companies and when one is selected it then fills in the technician's names in cboContact. Additionally, I want when Technican Expense is selected it's account number to be posted i.e. 540.
    Help!
    Frank Hoeffer

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxs Lookup (2002)

    Hmm... <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> Gonna need more info for this one...

    Can you share a little more about your data structure? Do you have these items in separate tables? If so, what kind of relationships are you using to connect them (such as one-to-many)?

    How are you currently trying to do this? Are you using the OnChange event of the indicated combo boxes? Since you said that you're planning to select items from two combo boxes before looking up the results, I would suggest checking for an existing value in BOTH boxes before looking up the info. You could also assign the lookup task to a button.

    What to you mean by an account number being posted?

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxs Lookup (2002)

    Hi Mark,
    I'm kinda of in the heat of things and do appreciate your help will exlain structure shortly.
    Frank

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxs Lookup (2002)

    I have two tables: tblVendors-Categories and tblVendors.
    The primary key is AccountNumber with tblVendors-Categories having a one to many relationship with tblVendors.
    I made a query and put tblVendors-Categories AccountNumber and Account in the query grid and from tblVendors CompanyName and ContactName. This gives the list I want.
    On my row of fields on a continuous form I pu =[cboAccount].[Column](0) in Account-That works and pops in the selected account's number but I can't get cboCompanyName to be populated with only the companies that are for the account i.e Technician's Companies Expense. and then when that is selected it should pull up on the Technicians Contacts Names.
    Frank

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxs Lookup (2002)

    Are you comfortable using events in a form's module? If so, you can use the OnChange event of Account combo to requery the Company Name combo. Set the Company Name combo's row source to filter for the Account Number - like this (Substitute your own field and form names):
    AccountNumber = [Forms]![FormName]![AccountNumberComboName]

    That should do it!

  6. #6
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    That Did it!

    That Did it!
    Thanks Frank

Posting Permissions

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