When the user enters and invalid WR#, they get a runtime error 3021, no current record, which fails at CurrentDb.Execute strSQL. Is there a way to let the user know, via an input box and eliminate the system error from occurring? Part of the code is below.
strSQL = "INSERT INTO TempRefund_Customers ([ParentWRNumber], [CSSPremiseNumber], [Area], [CustomerName],[JobAddress], " & _
"[BillingAddressName], [BillingAddress],[BillingCity], [BillingState],[BillingZipCode], [OpUnit],[UType],[ProjectID],[Activity],[RefundableTotal],[CompletionDate]," & _
"[Status],[WRDesc],[TypeWR],[JobType]) Values ('" & intWRNumber & "','" & stPremise & "','" & stArea & "','" & stCustName & "'," & _
"'" & stJobAddress & "','" & stBillName & "','" & stBillAdd & "','" & stBillCity & "','" & stBillState & "', " & _
"'" & stBillZip & "','" & stOpUnit & "','" & stUType & "','" & stProjectID & "','" & stActivityID & "','" & intTotal & "','" & dtCompleteDate & "'," & _
"'" & stStatus & "','" & stWRDesc & "','" & stTypeWR & "','" & stJobType & "')"
CurrentDb.Execute strSQL
strSQL = "INSERT INTO TempRefund_Customers ([ParentWRNumber], [CSSPremiseNumber], [Area], [CustomerName],[JobAddress], " & _
"[BillingAddressName], [BillingAddress],[BillingCity], [BillingState],[BillingZipCode], [OpUnit],[UType],[ProjectID],[Activity],[RefundableTotal],[CompletionDate]," & _
"[Status],[WRDesc],[TypeWR],[JobType]) Values ('" & intWRNumber & "','" & stPremise & "','" & stArea & "','" & stCustName & "'," & _
"'" & stJobAddress & "','" & stBillName & "','" & stBillAdd & "','" & stBillCity & "','" & stBillState & "', " & _
"'" & stBillZip & "','" & stOpUnit & "','" & stUType & "','" & stProjectID & "','" & stActivityID & "','" & intTotal & "','" & dtCompleteDate & "'," & _
"'" & stStatus & "','" & stWRDesc & "','" & stTypeWR & "','" & stJobType & "')"
CurrentDb.Execute strSQL