Results 1 to 4 of 4
  1. #1
    Kav91 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    2

    Query Help

    Hi,

    I'm actually trying to help a friend out, I've used access as a database for Visual Basic, but barely using its design view.

    This is the table were working with

    table name: Work Centre For Printing

    primary key | Work Centre Name | Work Centre Description
    10 | LAM | Lamintor
    11 | P-10 | Comexi 1


    12 | P-11 | Printing Machine No. 11


    in his form he has 2 combo boxes, named cbWorkCentre and cbWCD

    in Row Source for cbWorkCentre its: SELECT [Work Centre Name] FROM [Work Centre For Printing];

    what were trying to do is when a value is selected in cbWorkCentre say P-10 in cbWCD 'Comexi 1' should come up or if its P-11 , in cbWCD 'Printing Machine No. 11' should come up.

    so for the row source in Work Centre Description, how can I write this?

    So far I've come up with,

    SELECT [Work Centre Description] FROM [Work Centre For Printing] WHERE [Work Centre Name]=cbWorkCentre.Text;

    but i get no luck

    any help is appreciated
    thx

  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,521
    If you just want to display the description, add it to the row source of the first combo, change the column count property to 2 and have this as the control source of a textbox:

    =cbWorkCentr.Column(1)

    The column property is zero based, so 1 refers to the second column.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Kav91 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    2
    thanx mate, worked like a charm

  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,521
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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