Basic table lookup in Access 2000 combo boxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alienz

    #1

    Basic table lookup in Access 2000 combo boxes

    Anybody?
    This is probably a very simple question.
    I am just testing this on my own. I have 2 tables:

    Table name:fields
    Employer: Employer Number (primary key), Employer Name
    Employee: SIN, Name, Employer Number

    I have related Employer Number in the relationship area for both
    tables.

    I then created a forum and it has the employee information. I now
    want the employer name to appear as read only when I type in the SIN
    of the employee. I created a read only combo box and typed into the
    "row source" area of the properties :

    - SELECT Employer.[Employer Name] FROM Employer;

    - But this only gives me a drop down list of the Employers and it
    doesn't automatically update the employers depending on the SIN of the
    Employee I type in.

    Anyway, this all works when I use the wizard but I was wondering why
    it didn't work when I tried to do it manually using SELECT commands in
    SQL?????

    Special Alien thanks to anyone out there!!
  • Allen Browne

    #2
    Re: Basic table lookup in Access 2000 combo boxes

    Open your form in design view.
    Right-click the combo and choose Properties.
    Set these properties for your combo:
    Column Count 2
    Column Widths 0
    Bound Column 1
    Control Source Employee Number
    RowSource SELECT Employer.[Employee Number], Employer.[Employer
    Name] FROM Employer;

    The combo now has 2 columns. The first column is the bound column, so it
    stores the Employee Number. However, this column is zero-width, so it
    displays the employee name.

    The bit I wasn't sure about was why aliens are interested the sins of
    employees? Maybe there is a judgement day. :-)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Alienz" <kstetka@yahoo. com> wrote in message
    news:58e54da4.0 405171513.57fad 84d@posting.goo gle.com...[color=blue]
    > Anybody?
    > This is probably a very simple question.
    > I am just testing this on my own. I have 2 tables:
    >
    > Table name:fields
    > Employer: Employer Number (primary key), Employer Name
    > Employee: SIN, Name, Employer Number
    >
    > I have related Employer Number in the relationship area for both
    > tables.
    >
    > I then created a forum and it has the employee information. I now
    > want the employer name to appear as read only when I type in the SIN
    > of the employee. I created a read only combo box and typed into the
    > "row source" area of the properties :
    >
    > - SELECT Employer.[Employer Name] FROM Employer;
    >
    > - But this only gives me a drop down list of the Employers and it
    > doesn't automatically update the employers depending on the SIN of the
    > Employee I type in.
    >
    > Anyway, this all works when I use the wizard but I was wondering why
    > it didn't work when I tried to do it manually using SELECT commands in
    > SQL?????
    >
    > Special Alien thanks to anyone out there!![/color]


    Comment

    • Alienz on the www

      #3
      Re: Basic table lookup in Access 2000 combo boxes

      A huge alien high 3 out to you!!! I have accomplished the task that has
      taken my alien mind on quite a journey. I am just trying to understand
      the concepts of SIN and Employer and I think it is quite interesting how
      every human is assigned a separate one of each. I must stop typing now
      as I have slimed up my keyboard.

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Alienz on the www

        #4
        Re: Basic table lookup in Access 2000 combo boxes

        Yes, yes, look at all of these sinful employees appear before my eyes!
        Unfortunately, I'm a friendly alien and I will do no harm :(

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...