By looking at your code, I see a lot of potential problems.
First, where is this code located? It looks like it's a button on your form called Delete_Claim_CMD. It also looks like the code is run when someone clicks on the button.
If so, which table is the record source for your form? Is it tbl_master_data or TblAllCustRet or something else or nothing (an unbound form)?
Which tables are open at the time the person clicks the button? Is there another form open that has another table as its record source? Is the code you posted mentioning tables that are not open by any form at all at the time the user clicks the button?
Putting a criteria in your query in the claim number field mentioning any open form's record's claim number value will also simplify the code. But I'd have to know which form is open when the query is run.
The answers to these questions will determine what your code should look like.
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|