Hiding previously selected records in combobox

G

Guest

I have searched, honest guv! Can't find eventhough I've seen it before!...

I have a form with a number of Comboboxes on, which relate to a group (each
10). I need to be able to select a record once only, once selected I don't
want the user to have the option to choose this record again (any form). How
do I do it? I have tried adding a field in the original table and on the
after_update property of the combobox but can't seem to call it (add data to
it) from the form (possibly not a good thing to do anyway?). I also need to
identify which records have been selected with which groups (selected via the
first in a series of cascading cbo's)]

Any help much appreciated.

Martin
 
K

kingston via AccessMonster.com

What happens after a selection is made? Is there any way you can identify
which items have been selected? Do you have to do this for every user and
when would you reset the selections?

Let's say you only have one user and you never want to reset the list. Using
the combobox's AfterUpdate event, you could set a flag (Yes/No field) in the
table behind the RowSource. The combobox's RowSource would be all of the
records where the flag was not set. There are lots of ways this might be
done. The main thing is how do you tell via data changes whether a selection
was made? If there isn't a way to do this, you will have to create on (e.g.
adding a Yes/No field).
I have searched, honest guv! Can't find eventhough I've seen it before!...

I have a form with a number of Comboboxes on, which relate to a group (each
10). I need to be able to select a record once only, once selected I don't
want the user to have the option to choose this record again (any form). How
do I do it? I have tried adding a field in the original table and on the
after_update property of the combobox but can't seem to call it (add data to
it) from the form (possibly not a good thing to do anyway?). I also need to
identify which records have been selected with which groups (selected via the
first in a series of cascading cbo's)]

Any help much appreciated.

Martin
 
G

Guest

Ok, the combo boxes are grouped on a form, pertaining to the day/time. Under
each group (one class) I have a button which I thought I might use to
'update' or 'record' the selections which in turn would populate a separate
column (yes/no) in the table, the query then not picking these records up in
subsequent sql's. The problem is I am not sure how to 'tell' the table to
populate the yes no box - I have tried 'table.students.current = "Yes"' to no
avail - I guess this is the incorrect syntax?


kingston via AccessMonster.com said:
What happens after a selection is made? Is there any way you can identify
which items have been selected? Do you have to do this for every user and
when would you reset the selections?

Let's say you only have one user and you never want to reset the list. Using
the combobox's AfterUpdate event, you could set a flag (Yes/No field) in the
table behind the RowSource. The combobox's RowSource would be all of the
records where the flag was not set. There are lots of ways this might be
done. The main thing is how do you tell via data changes whether a selection
was made? If there isn't a way to do this, you will have to create on (e.g.
adding a Yes/No field).
I have searched, honest guv! Can't find eventhough I've seen it before!...

I have a form with a number of Comboboxes on, which relate to a group (each
10). I need to be able to select a record once only, once selected I don't
want the user to have the option to choose this record again (any form). How
do I do it? I have tried adding a field in the original table and on the
after_update property of the combobox but can't seem to call it (add data to
it) from the form (possibly not a good thing to do anyway?). I also need to
identify which records have been selected with which groups (selected via the
first in a series of cascading cbo's)]

Any help much appreciated.

Martin
 
K

kingston via AccessMonster.com

Use the combobox's AfterUpdate event to modify the data. First, the
underlying table must have a Yes/No field or you can create a separate table
that holds this flag with a foreign key from the main table. When a
selection is made in the combobox, run an UPDATE query:

strSQL = "UPDATE Table SET YesNo=-1 WHERE [Key]='" & Me.ComboBox = "';"
DoCmd.RunSQL strSQL

If your combobox's RowSource filters out records with this box checked (e.g.
SELECT... FROM... WHERE YesNo=0;), you should be able to requery the control
to update the selections immediately. Otherwise, next time the form is
loaded, the combobox will not show those selections.
Ok, the combo boxes are grouped on a form, pertaining to the day/time. Under
each group (one class) I have a button which I thought I might use to
'update' or 'record' the selections which in turn would populate a separate
column (yes/no) in the table, the query then not picking these records up in
subsequent sql's. The problem is I am not sure how to 'tell' the table to
populate the yes no box - I have tried 'table.students.current = "Yes"' to no
avail - I guess this is the incorrect syntax?
What happens after a selection is made? Is there any way you can identify
which items have been selected? Do you have to do this for every user and
[quoted text clipped - 22 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top