Καλημερα.Τασος οπως εχεις αναφερει εδω
https://www.ms-office.gr/forum/acces...is-access.html τα εχω κανει οπως ειπες ,απλα μου βγαζει σφαλμα.Οι πινακες μου ειναι σε sql server.
Runtime error "3027".Δεν ειναι δυνατη η ενημερωση .Η βαση δεδομενων η το αντικειμενο ειναι μονο για αναγνωση
Function LogAction(obj As Object, Optional LastID&)
With CurrentDb.OpenRecordset("tblLog", 2, dbSeeChanges)
If LastID Then
LastID = IIf(obj.Tag <> vbNullString, obj.Tag, -1)
obj.Tag = vbNullString
.MoveFirst
.FindFirst "LogID = " & LastID
If Not .NoMatch Then
.Edit
.Fields("CloseDateTime") = Now
End If
Else
.AddNew
<-- εδω μου βγαζει το error
LastID = .Fields("LogID")
obj.Tag = LastID
.Fields("OpenDateTime") = Now
.Fields("DocName") = obj.name
.Fields("ComputerName") = Environ("COMPUTERNAME")
.Fields("WinUser") = Environ("USERNAME")
.Fields("AppUser") = App_User
End If
.Update
.Close
End With
End Function