Combo Box- Make Names disappear from list after data entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone,
I have Access 2003. I want to know how i can make names in a combo box
disappear after records for that person have been updated.

I'm setting up an application that keeps up with employee hours ,once a
month I have to do this. I have the employee names in a combo box. When I
select John Doe from the list, the records for John Doe appear on the form.
Once I update the hours for John Doe, I want his name to disappear from the
combo box, this will help me to keep track of whose records I've already
updated, if I'm doing a number of employees at one sitting.

However, say I get called away to do something else. I close the form. When
I come back I want to be able to see all the names in the combo box, but it
would be nice to click a check box to once again limit the list to only those
employees whose records have not ben updated for the month.

TIA,
 
I'll give it a try,
thanks.

Klatuu said:
How you do this will depend on what your Row Source is. I will assume you are
using a query.
Hopefully, there is something in the table where you keep the hours that you
could add to your query that will allow you to know whether John Doe has been
updated.

Ok, now, don't put that in your Row Source just yet. This is because you
want the form to open with all names, and with the click of a magic command
button, remove the names that have been updated.

So, in the Click Event of the command button, you can modify the row source

strNewSource = Me.MyCombo.RowSource
strNewSource = strNewSource & 'the criteria you need to add to filter out
updated
Me.MyCombo.RowSource = strNewSource
Me.MyCombo.Requery
 
How you do this will depend on what your Row Source is. I will assume you are
using a query.
Hopefully, there is something in the table where you keep the hours that you
could add to your query that will allow you to know whether John Doe has been
updated.

Ok, now, don't put that in your Row Source just yet. This is because you
want the form to open with all names, and with the click of a magic command
button, remove the names that have been updated.

So, in the Click Event of the command button, you can modify the row source

strNewSource = Me.MyCombo.RowSource
strNewSource = strNewSource & 'the criteria you need to add to filter out
updated
Me.MyCombo.RowSource = strNewSource
Me.MyCombo.Requery
 
Back
Top