Hi,



I have the following query:

SELECT [Personnel Records].[Allocated Safety Number]
FROM [Personnel Records]
WHERE ((([Personnel Records].[Allocated Safety Number])=[SCAN BARCODE]));

I have a message/text box that comes up asking for data, in this case Barcode Data (a number).

What I want to do is loop this query (end result is an adjustment to a form).

What I need though is for when a user clicks cancel on the message box, it ends the loop.

The application keeps a list of people checking on/off. The form will stay open in the background while this query runs in a loop so the person can see a checkbox change status as they scan their barcode. (barcode scans and sends carraige return to click 'yes' on textbox.)

So, how can I achieve the same thing with the query looping, maybe with a macro, so that when cancel is pressed it ends the loop.

Thanks for your help.

Stewart