create form field to enter the code, and a recordset that will query the table holding the codes and filter it using the form element.
then in server valadtion, add numeric validation. set the server variable to "$totalRows_recordsetName" where recordsetName is the name of the recordset, set the minimum to 1 and the max to 100, this will pass validation only if he code is found in the database.