Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2005
    Posts
    1

    Unanswered: Basic Question - Forms and Combo Boxes

    Hi, Im new to access.

    Making a form to view a table.

    Table has fields:
    Name
    Issue 1
    Issue 2
    Issue 3
    Issue 4

    I have the names as a combo box on the form.
    I want the issue 1, 2, 3 and 4 to pull out the enteries under that name when a different name is selected.

    Does this make sense?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Yes it does ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    happy weekend Mike!

    meanwhile, i worry about any table that looks like
    Name
    Issue 1
    Issue 2
    Issue 3
    Issue 4

    ...where will you put the 5th issue??
    ...why waste the space for those names with only 1 issue.

    why not:

    tblNames:
    IDname, auto, PK
    strName

    tblIssue:
    IDissue, auto, PK
    IDname, FK (the name that owns this issue)
    strIssue, text, whatever the issue is

    you now have a relational database instead of an expensive version of Windows-Notepad, and you can handle zero to millions of issues for a given name.

    oh... and forget spaces in field names - will save you heaps of time later.


    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Since no one else said it: Welcome to the Forum !

    As Izyrider stated normalize the DB. When that is done the rest is easy.
    Darasen

  5. #5
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    What you need is as follows: In the AfterUpdate event of your combo box, type in:

    DoCmd.RunSQL "SELECT issue1, issue2, issue3, issue4 where name = '" & ComboBox1.Value & "'"

    This will populate your issue text boxes for you.

    Sam

    PS Before the first ampersand, the order of quotes is first ', then ". After the second ampersand, it's " then ' then " again. Good luck.

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Sam Landy
    What you need is as follows: In the AfterUpdate event of your combo box, type in:

    DoCmd.RunSQL "SELECT issue1, issue2, issue3, issue4 where name = '" & ComboBox1.Value & "'"

    This will populate your issue text boxes for you.

    Sam

    PS Before the first ampersand, the order of quotes is first ', then ". After the second ampersand, it's " then ' then " again. Good luck.
    Error. Error. Error. RunSQL accepts only ACTION queries (UPDATE, DELETE, APPEND, etc ...)

    The text boxes in question could be bound to a query ... Or the textbox could be set by using a query thru ADO or DAO ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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