Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterate through records to check if value exists

Status
Not open for further replies.

SimonPGreen

IS-IT--Management
Mar 8, 2004
116
GB
Hi,

I have a table and one of the fields is a boolean datatype and i need to ensure that only one record has this set to -1

Access to this field is via a form and I would like to trap the before update event on the tick box bound to the field, iterate through the records to check the flag status and then either update or msgbox the user and exit if the flag is already set.

Any idea on the best way to achieve this.

Appreciate any help.

Regards,

Simon
 
Is the database small enough to use DLookup or DCount (takes overhead on large mdb's)? Could see if "where booleanvariable = 1" returns anything and go from there...

Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.
 
Thanks Genomon,

Records limited to about 20 so overhead shouldn't be an issue.

Regards,

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top