Hi,
When trying to update a table with certid as primary key (Access), the field certid field cannot be updated. However if the line !certid = val(txtfields(0)) is commented out the updating line will overwrite the first 0 certid (or the first certid).
Please help, ay help will be very much appreciated. Thanks, in advance for any help.
Code:
Dim RecSource As Recordset
Dim RecDatabase As Database
Set RecDatabase = OpenDatabase("c:\SRS\SRS_Lic.mdb")
Set RecSource = RecDatabase.OpenRecordset("Certificate Details", dbOpenDynaset)
' Update new record
With RecSource
.Edit
!CertID = Val(txtFields(0)) ' this is the line which is causing the problems
!CertType = txtFields(1)
!CertNo = txtFields(2)
!CertExpiry = txtFields(3)
!DriverID = Val(txtFields(4))
.Update
.Bookmark = .LastModified
End With
RecSource.Close
RecDatabase.Close
