Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2004
    Posts
    5

    Unanswered: My Row Source Delimma

    Here is my delimma,

    I have, in a form, a drop down box from which I select a district. In the next box, I have another drop down, which lists all the counties in our state. What I am trying to acheive is, when I select a particular district, that I get only the counties assigned to that district. Example: I select District 2 in my first drop down, which will then be only populated with the counties in District 2.

    I already have my tables set with the District number and the Counties assigned, ready to link, however, I can't get them to match!! Any and all help is greatly appreciated!

  2. #2
    Join Date
    Aug 2004
    Location
    Steamboat Springs, CO
    Posts
    37
    the rowsource should be a query or sql statement that selects the counties from your table where district number is [forms]!{yourformnamehere]![yourdistrictcomboboxnamehere]

    So that string goes in district number column criteria of your query design, or sql statement design.

    Jeremy Brooks
    PSIA-RM

  3. #3
    Join Date
    Aug 2004
    Posts
    5
    below is what my row source looks like, when I attempt, it tells me... Characters found after end of SQL statment.

    SELECT [DISTRICT-COUNTY BREAKDOWN].COUNTY FROM [DISTRICT-COUNTY BREAKDOWN]; WHERE DISTRICT NUMBER IS [FORMS]![FATALITIES]![DISTRICT]

    Did I use the wrong brackets, or am I missing something?

  4. #4
    Join Date
    Aug 2004
    Location
    Steamboat Springs, CO
    Posts
    37
    SELECT [district-county breakdown].County
    FROM [district-county breakdown]
    WHERE ((([district-county breakdown].county)=[FORMS]![FATALITIES]![DISTRICT]))

    Should work

  5. #5
    Join Date
    Aug 2004
    Location
    Steamboat Springs, CO
    Posts
    37
    Sorry, I forgot what we were trying to accomplish....This should work

    SELECT [district-county breakdown].county, [district-county breakdown].district
    FROM [district-county breakdown]
    WHERE ((([district-county breakdown].district)=[FORMS]![FATALITIES]![DISTRICT]));

  6. #6
    Join Date
    Aug 2004
    Posts
    5
    Thank you. I am only having one problem now, it sometimes doesn't change the county, when I add a new record and change the district, it keeps the previous county listing. I have to close after adding a record, then reopen to refresh it. Any ideas? I just copied and pasted your string in the row source box, so I shouldn't have done anything to mess that up, but I will copy it here just in case.

    SELECT [district-county breakdown].county, [district-county breakdown].district FROM [district-county breakdown] WHERE ((([district-county breakdown].district)=FORMS!FATALITIES!DISTRICT));

  7. #7
    Join Date
    Aug 2004
    Location
    Steamboat Springs, CO
    Posts
    37
    Add this code to the update event of whatever you're doing that's not refreshing the comboboxes.

    me![whateverthenameofthecombothatsnotrefreshinghere].requery

    That should do it

    jeremy

  8. #8
    Join Date
    Aug 2004
    Location
    Steamboat Springs, CO
    Posts
    37
    Add this code to the update event of whatever you're doing that's not refreshing the comboboxes.

    me![whateverthenameofthecomboboxthatsnotrefreshinghere].requery

    That should do it

    jeremy

Posting Permissions

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