• Hi

    My apologies for not being able to contribute to this earlier - I'm fairly certainthat I am in a different time zone to you.

    If you are wanting to do this in an Access query, then you could use a LEFT OUTER join. Join the table with the incrementing number to the table you wish to check via the two number attributes, then set the join type to the left outer join option (2).

    If you create a test query in this way (Important Note: drag your join from the table with the incrementing number to the table you wish to check) and simply add the two attribute, you will see matching numbers where you have used the number and the incrementing number and a null in the cases where the numbers haven't been used.

    Taking this a step further, add a null criteria for the attribute in the table you are checking, and you will be returned a set of numbers that haven't been used. You could then use this as a subquery for generating the next unused number by changing the query to a group (aggreagte) query and use the min option.

    Cheers

    Rowan