|
-
Dec 10th, 2001, 07:42 AM
#1
Thread Starter
New Member
Updating Fields DAO
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|