Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259

    Unanswered: Combobox in Table: Possible?

    Hi, i dont know if i posted this thread before..but here goes

    its possible to have secondary linked combo boxes in a form..ie the selection you make in one combo affects the list that will appear in another.

    how would u do that in a table in spreadsheet mode..as in Field1 has combo choices. i select something, and that affects the choices in Field2?

    tks

  2. #2
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    To my limited knowledge this is not really possible. Though I guess anything is possible with enough coding.
    I must wonder why this would be needed though. This can be done in a form easily enough and a Table is not really meant to be a data entry form.
    Darasen

  3. #3
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259
    most of the changes would go through the form side..

    but when the user does queries to change the data, then they would change it at the table level.

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by Jerrie
    most of the changes would go through the form side..

    but when the user does queries to change the data, then they would change it at the table level.
    HI Jerrie,

    I am with Darasen, having your users work at Table level can be very disastrous. You should develop Forms and Queries. The Queries will feed the exact data to your forms for the users to input and manipulate. The ending result will still be stored in the table, unless it is a calculated field. So I would advise against using Tables as a source of Data Entry.
    Now, that being said, check back later on today. I found a sample of just what you are looking for. But even then, it is not at the Table, but in a form which has 2 ComboBoxes. You make a selection in the first box and the data for the second is changed to pull from the now changed options are in the first. Like this, in the beginning both ComboBoxes are blank. In the first you are to choose a State. Once you do that, the second ComboBox will only show you the Cities within the selected state. Sound like what you need???
    Heading to be now it's almost 3a.m. but will try to find it and post it on here for you.
    Remember from a safety and logical point of view, do not use a Table for data entry purposes. You can create a Form to do that and Design it for DatasheetView, which resembles the look of a Table. My reason for this, Tables are very volatile and allowing someone access directly to it, with them not knowing it or it being intentional, they can accidentally delete a Field/Record, wipe out data when moving to that field, etc....you get the picture. Just passing along what was taught from the pros.

    have a nice day
    BUD
    keep a look out for later today, unless someone else resolves it before I get back.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    having your users work at Table level can be very disastrous. You should develop Forms and Queries.
    It's now been said twice.. but it couldn't hurt to say it again...

    google up "cascading combo boxes" too, that's the techy-talk for what you want to do. There's a couple ways to do it, dig around and see which is best for you.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259
    yes i knw..the disasters of working at table level are enormous..since they aren't imposed restrictions..but our adminstrators have sufficient knowledge with the DB and + the use for which i'm using this for is not a complicated situation. Its a simple cascading solution with two combo boxes;

    i have done it before a lot of times on forms, with 2 or 3 combo boxes...where they 'cascade' of each other..that aint hard

    BUT, aside from all the generous warnings you guys have given, i just need a straight answer if this is indeed possible at THE TABLE level.

    Once again, i dont mean to be brusque, i just need to know if its possible.

  7. #7
    Join Date
    Oct 2003
    Posts
    81
    Simple Solution:

    On the "On Got Focus" Event of the second control, run a select query which uses the value of the first control as part of the criteria.

    Eg. using the country state idea:

    Dim strCountry as string ' Declare your variable

    strCountry = me.cboCountry ' set your variable

    me.cboState.rowsource = "SELECT [tblCountry].State, [tblCountry].Country " _
    & "FROM [tblCountry] " _
    & "WHERE (([tblCountry].Country)=" & "'" & strCountry & "'" & ");")

    That way you whenever you change the country combo box, and then click the state combo box, it will be updated.

  8. #8
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Once again, i dont mean to be brusque, i just need to know if its possible.
    No.
    That said there may be a way with extensive programming in a module or to Access itself but for all intents and practical purposes the answer seems to be no.
    Darasen

  9. #9
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi again Jerrie,

    Well, for my final conclusion on this matter is that can't be done at table level. I asked around and nobody I talked to knew of how you program easily if at all at Table level. Might have to find you a real programming heavy hitter to make the table work that way. With Forms as you know you can go behind the scenes to do fancy work, but not known of a way to control Tables that way. I was told that Tables are just holding tanks for the raw data. So from me, NOT AN EXPERT, it can't be done.
    Not really sure why if it can be done easily in a form it just HAS to be done in a Table. Isn't the end result to just get it done? Not being a smarty or anything just trying to get a better insight myself. After all, I come here not only to try to help, BUT to learn as well....so that is why I always ask.

    Hey, if you find a way I would appreciate you posting the solution here for all to see, then we will all be the wiser.

    have a nice day and it's been fun
    BUD

Posting Permissions

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