Hello, Im new to coding VBA and running into a snag. The transferspreadsheet command gives a runtime error 3027. Database or object is read-only. Any ideas?? Thanks in advance
Private Sub Command5_Click()
Dim rs As ADODB.Recordset
Set rs = CurrentProject.Connection.Execute("Store_List")
rs.MoveFirst
Do While Not rs.EOF
Me.Text0.Value = rs.Fields(0)
DoCmd.OpenQuery "KSN", acViewNormal, acEdit DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "KSN", "C:\Spaceman" & Me.Text0.Value & ".csv"
DoCmd.Close
rs.MoveNext
Loop
End Sub
Private Sub Command5_Click()
Dim rs As ADODB.Recordset
Set rs = CurrentProject.Connection.Execute("Store_List")
rs.MoveFirst
Do While Not rs.EOF
Me.Text0.Value = rs.Fields(0)
DoCmd.OpenQuery "KSN", acViewNormal, acEdit DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "KSN", "C:\Spaceman" & Me.Text0.Value & ".csv"
DoCmd.Close
rs.MoveNext
Loop
End Sub