title: Setting Rowsource property issue
body: <p>I keep getting an error message every time I try to test the macro, after assigning it to a cell in my excel file.</p>
  <p>This is what the error says: Run Time error '380'
  &quot;Could not set the RowSource property. Invalid Property Value.&quot;
  I've included a screenshot of this message and a copy of my (borrowed) code below.
  The strange thing is that I get zero issues when I debug the code (Compile VBA Project). However, when I try to run the macro from my excel file after assigning it, I get the error message.</p>
  <pre><code> Option Explicit
  Sub Reset()
  
  Dim iRow As Long
  
  iRow = [Counta(Database!A:A)] ' identifying the last row
  
  With frmForm
  
  
    .txtFSA.Value = &quot;&quot;
    .txtCert.Value = &quot;&quot;
    .txtPSU.Value = &quot;&quot;
    .txtSelecDate.Value = &quot;&quot;
    .txtFRCode.Value = &quot;&quot;
    .txtGrade.Value = &quot;&quot;
    .txtPay.Value = &quot;&quot;
    .txtTrackOut.Value = &quot;&quot;
    .txtTrackIN.Value = &quot;&quot;
    .txtNHPDate = &quot;&quot;
    
    .txtName.Value = &quot;&quot;
    .txtLastName.Value = &quot;&quot;
    .OptMale.Value = False
    .OptFemale.Value = False
    .txtDOB.Value = &quot;&quot;
    .txtPhone.Value = &quot;&quot;
    .txtEmail.Value = &quot;&quot;
    .txtAddress.Value = &quot;&quot;
    .txtCity.Value = &quot;&quot;
    .txtZip.Value = &quot;&quot;
    .txtState.Value = &quot;&quot;
    
    .CmbSurvey.Clear
    
    .CmbSurvey.AddItem &quot;AHS&quot;
    .CmbSurvey.AddItem &quot;CPS&quot;
    .CmbSurvey.AddItem &quot;SIPP&quot;
    .CmbSurvey.AddItem &quot;NIHS&quot;
    
    .LstDatabase.ColumnCount = 24
    .LstDatabase.ColumnHeads = True
    
   ' .LstDatabase.ColumnWidths = &quot;75 pt; 0pt&quot;
   
    
    If iRow &gt; 1 Then
    
      .LstDatabase.RowSource = &quot;Database!A2:X&quot; &amp; iRow
    
    Else
    .LstDatabase.RowSource = &quot;Database!A2:X2&quot;
    
    End If
    
  
  
  End With
  
  
  End Sub
  
  
  
  Sub Submit()
  
  Dim sh As Worksheet
  Dim iRow As Long
  
  
  
  Set sh = ThisWorkbook.Sheets(&quot;Database&quot;)
  
  
  iRow = [Counta(Database!A:A)] + 1
  
  With sh
      .Cells(iRow, 1) = iRow - 1
      
       .Cells(iRow, 2) = frmForm.CmbSurvey
       .Cells(iRow, 3) = frmForm.txtFSA
       .Cells(iRow, 4) = frmForm.txtCert
       .Cells(iRow, 5) = frmForm.txtPSU
       .Cells(iRow, 6) = frmForm.txtSelecDate
       .Cells(iRow, 7) = frmForm.txtName
       .Cells(iRow, 8) = frmForm.txtLastName
       .Cells(iRow, 9) = IIf(frmForm.OptFemale.Value = True, &quot;Female&quot;, &quot;Male&quot;)
       .Cells(iRow, 10) = frmForm.txtDOB
       .Cells(iRow, 11) = frmForm.txtAddress
       .Cells(iRow, 12) = frmForm.txtCity
       .Cells(iRow, 13) = frmForm.txtZip
       .Cells(iRow, 14) = frmForm.txtState
       .Cells(iRow, 15) = frmForm.txtPhone
       .Cells(iRow, 16) = frmForm.txtEmail
       .Cells(iRow, 17) = frmForm.txtFRCode
       .Cells(iRow, 18) = frmForm.txtGrade
       .Cells(iRow, 19) = frmForm.txtPay
       .Cells(iRow, 20) = frmForm.txtNHPDate
       .Cells(iRow, 21) = frmForm.txtTrackOut
       .Cells(iRow, 22) = frmForm.txtTrackIN
       .Cells(iRow, 23) = Application.UserName
       .Cells(iRow, 24) = [Text(Now(), &quot;DD-MM-YYYY-HH:MM:SS&quot;)]
  
  End With
  
  End Sub
  
  
  Sub Show_Form()
  
    
      frmForm.Show
    
  
  
  
  End Sub
  </code></pre>
  <p><a href="https://i.stack.imgur.com/bkDix.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkDix.png" alt="enter image description here" /></a></p>