I have an excel workbook, one of the sheets contains a long list of people, whose data I use in the access project. The file is linked to access via
Code:
doCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, "LibroSoci", _
ExcelPath & "Libro Soci.xlsm", True, "LibroSoci!"
where LibroSoci is the sheet I am interested in. Most of the time the table is used to get info (e.g. filling a combo box in a form), but in rare occasions I would like to chenge a couple of fields in a record:
Code:
sql1 = "SELECT * FROM LibroSoci WHERE [Numero tessera] = " & NTes
Set rstLibroSoci = CurrentDb.OpenRecordset(sql1)
rstLibroSoci.Edit
If Month(nDate) > 8 Then
rstLibroSoci![Quota associativa] = Year(nDate) + 1
Else
rstLibroSoci![Quota associativa] = Year(nDate)
End If
If Me.Nuova_TessElett <> "" Then rstLibroSoci![Tessera Elettronica n] = Me.Nuova_TessElett
rstLibroSoci.Update
rstLibroSoci.Close
Set rstLibroSoci = Nothing
This code does not work, complaining that the table is readonly. Maybe I am missing something basic here. Linking a table implies it being readonly? And is there any different way to do what I do? And, is the original excel workbook open to edit in Excel?
Thanks for your patience in explaining something maybe elementary I am overlooking.