I am testing a Data Entry Form I created to make sure it throws a message box when all required fields aren't populated. So I left all fields blank and when I click submit it throws a runtime error '2465' Microsoft Access can't find the field '|' referred to in your expression.
Below is the code:
the debugger is highlighting the If statement but I can't find anything wrong with it.
Below is the code:
Code:
Private Sub Command21_Click()
Dim Rs As Recordset
If (IsNull(Me.[Request Batch].Value) = False And IsNull(Me.[Provider].Value) = False _
And IsNull(Me.[Requestor].Value) = False And IsNull(Me.[Patient or Client Name].Value) = False _
And IsNull(Me.[Lab Site Name].Value) = False And IsNull(Me.[Lab Site Name].Value) = False And _
IsNull(Me.[Account Number].Value) = False And IsNull(Me.[Refund To].Value) = False _
And IsNull(Me.[Refund Reason].Value) = False And IsNull(Me.[Invoice Number].Value) = False _
And IsNull(Me.[Refund Amount].Value) = False And IsNull(Me.[Date of Service].Value) = False) = True Then
'Updates Refund Letter Table
Set Rs = CurrentDb.OpenRecordset("Main Table", dbOpenDynaset)
Rs.AddNew
Rs![Request Date] = Me.[Request Date]
Rs![Request Batch] = Me.[Request Batch]
Rs![Account Number] = Me.[Account Number]
Rs![Invoice Number] = Me.[Invoice Number]
Rs![Refund To] = Me.[Refund To]
Rs![Refund Amount] = Me.[Refund Amount]
Rs![Group Number] = Me.[Group Number]
Rs![Date of Service] = Me.[Date of Service]
Rs![Provider] = Me.[Provider]
Rs![Requestor] = Me.[Requestor]
Rs![Patient or Client Name] = Me.[Patient or Client Name]
Rs![Lab Site Name] = Me.[Lab Site Name]
Rs![Invoice Balance] = Me.[Invoice Balance]
Rs![Other Balances] = Me.[Other Balances]
Rs![Refund Reason] = Me.[Refund Reason]
Rs![Address on File?] = Me.[Address on File?]
Rs![Other Address] = Me.[Other Address]
Rs![Comments] = Me.Comments
Rs.Update
Rs.Close
Set Rs = Nothing
Else
MsgBox ("Please Review and Complete all Required Fields")
End If
the debugger is highlighting the If statement but I can't find anything wrong with it.