title: How to fix this error " error 3001: invalid argument"
body: <p>I have this problem in access VBA, it keep giving me error 3001: invalid argument. I'm new to this language and couldn't find where is my mistake or any other solution online.</p>
  
  <p>I'd really love the help.</p>
  
  <p>I tried to use DAO but it gives me the  "NAme conflicts with existing module..." error</p>
  
  <pre><code>      Public Function AuditChanges(RecordID As String, UserAction As String)
  On Error GoTo auditerr
  
  Dim DB As Database
  Dim rst As Recordset
  Dim clt As Control
  Dim UserLogin As String
  
  Set DB = CurrentDb
  Set rst = DB.OpenRecordset("select * from tbl_TRACKMP", adOpenDynamic)
  
  UserLogin = Environ("UserName")
  Select Case UserAction
      Case "new"
          With rst
              .AddNew
              ![DateTime] = Now()
              !UserName = UserLogin
              !FormName = Screen.ActiveForm.Name
              !Action = UserAction
              !RecordID = Screen.ActiveForm.Controls(RecordID).Value
              .Update
  
           End With
  
      Case "Delete"
          With rst
              .AddNew
              ![DateTime] = Now()
              !UserName = UserLogin
              !FormName = Screen.ActiveForm.Name
              !Action = UserAction
              !RecordID = Screen.ActiveForm.Controls(RecordID).Value
              .Update
  
          End With
  
      Case "Edit"
          For Each clt In Screen.ActiveForm.Controls
              If (clt.ControlType = acTextBox _
                  Or clt.ControlType = acComboBox) Then
                  If Nz(clt.Value) &lt;&gt; Nz(clt.OldValue) Then
                  With rst
                      .AddNew
                      ![DateTime] = Now()
                      !UserName = UserLogin
                      !FormName = Screen.ActiveForm.Name
                      !Action = UserAction
                      !RecordID = Screen.ActiveForm.Controls(RecordID).Value
                      !FieldName = clt.ControlSource
                      !OldValue = clt.OldValue
                      !newvalue = clt.Value
                      .Update
                  End With
              End If
          End If
  
      Next clt
  
  End Select
  
  rst.Close
  DB.Close
  Set rst = Nothing
  Set DB = Nothing
  auditerr:
  MsgBox Err.Number &amp; " : " &amp; Err.Description, vbCritical, "Error"
  Exit Function
  
  End Function
  </code></pre>