combo box failure

F

fredloh

i have a table with a yes/no field call "Edited". i have a button that
runs code to set the "Edited" field of a selected record to "yes". the
code also set the rowsource (using SQL Update and Set statement) of a
combo box to display only records with the "Edited" field = "No". the
button and the combo box are on the same form. the record is selected
from the combo box.

when i step through the code in debug mode, the combo box nicely
displays correctly only records with the "Edited" field = "No". which
could mean nothing wrong with the code? but when i click the button in
open form mode and open the combo box, the combo box displays both the
record with the "Edited" field = Yes and records with "Edited" field =
No. for the record where the "Edited" field has been set to "Yes", the
"edited" field displayed in the combo box shows a "No". the "Edited"
field change to a "Yes" only after i open the combo box twice. the
record with the "Edited" field = "Yes" disappears from the combo box
only after i have set another record's "Edited" field to "yes". this
does not happen all the time though.

what have i done wrong? what is the right way to do it so that the
combo box correctly display only records where "Edited" field ="No" at
all times?

thanks for your help.
 
J

Jerry Whittle

The criteria for Yes/No fields should be Yes or No - not "Yes" or "No". If
you are using quotation marks, that can cause problems. I couldn't really
tell from your post if you were using the quotes.

Actually 0 for No and -1 for Yes might work better.
 

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