Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    17

    Unanswered: change subform with listboxes

    hello
    i have three cascading listboxes (one changes another), and bellow them there is a subform, the subform actually reads the records of a table as it finds them, i want to create a resultset with the criteria selected in the comboboxes and make the subform read that resulset only, here is my table structure:
    Code:
    id name  list1 list2 list3
    1 blah   1     1     1
    2 blah2  1     1     1
    3 blah3  1     2     2
    4 blah4  2     3     4
    5 blah5  2     4     5
    so if i select the first value in the three lists i want the subform to go through the first two records only, and so on. how can i do this?? i'm familiar with vbcode but not so with access, so any help would be greatly appreciated, i'm attaching a screenshot for illustration

    --edit: now i'm realizing that a good option could be to let the subform behave naturally and only go to the first record that matches the criteria, and change the lists to match the categories of the products if the user goes thru the records with the little arrows, i'm working in the second feature but i haven't found a way to change the record shown in the subform

    thank you very much
    Attached Thumbnails Attached Thumbnails form.JPG  
    Last edited by ramone; 02-13-07 at 12:32.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Another method would be to add a Hide/NoHide column to your subform that you base the viewing of your records on ... So, for instance, you select "1" from list3 ... The combo would set the hide flag for all records not 1 in list3 then have the form requery ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2007
    Posts
    17
    hello M_owen, thanks for your reply, your proposition seems very interesting, the only thing that stops me now, as i said, is that i havent found how to push a resultset into the subform, the subform was created individually with the wizard and it only reads a table as is, then i dragged the subform into the main form.

    the algorithm i was imaging is this:

    1.select the three options
    2.in the last listbox's click event query like:
    Code:
    select top 1 id from table where list1=list1.value,list2=list2.value,list3=list3.value order by id asc
    3.then make the subform jump to the record with that id

    and i'll fgive it a try with your solution too, first i need to find how to manipulate the form's data

    thanks again for your help

Posting Permissions

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