NigelBishop
New member
- Local time
- Yesterday, 20:44
- Joined
- Oct 4, 2019
- Messages
- 14
Hello a quick back story
I have an access frontend hocked up to an SQL Server backend and all is working fine.
I have a form in Access is bound to a table in SQL and manually populating the form causes no issues.
I have been asked to add the ability to duplicate records to assist in data entry and to reduce data entry errors.
There is a Timestamp field [ValCol] in the table which is causing issues when I try to duplicate the record, I understand what the Timestamp field is within SQL and it automatically populates correctly when data is manually entered, however it doesn't appear to populate when I try to duplicate a record.
I am using the following code to perform the duplication (not all fields within the record are duplicated)
If I change the table to a local table and make the field [ValCol] not required the code runs fine.(the Highlighted code is not included)
To make the code run correctly with the SQL Backend I'm guessing that I need to provide the [ValCol] value however I have no Idea how to achieve this so any help would be gratefully received, maybe I need to take a completely different approach?
With Me.RecordsetClone
.ADDNEW
![ResultDate].Value = [T_RDate]
![RefType].Value = [RefType]
![QCRef].Value = [QCRef]
![Area].Value = [Area]
![TypeOfSample].Value = [TypeOfSample]
![Room].Value = [Room]
![Site].Value = [Site]
![Enteredby].Value = UCase(NetworkUserName())
' ![ValCol].Value = ?????????? ----------This is the part of the code I need help with
.Update
' 'Display the new duplicate.
Me.Bookmark = .LastModified
End With
Thank you in advance
I have an access frontend hocked up to an SQL Server backend and all is working fine.
I have a form in Access is bound to a table in SQL and manually populating the form causes no issues.
I have been asked to add the ability to duplicate records to assist in data entry and to reduce data entry errors.
There is a Timestamp field [ValCol] in the table which is causing issues when I try to duplicate the record, I understand what the Timestamp field is within SQL and it automatically populates correctly when data is manually entered, however it doesn't appear to populate when I try to duplicate a record.
I am using the following code to perform the duplication (not all fields within the record are duplicated)
If I change the table to a local table and make the field [ValCol] not required the code runs fine.(the Highlighted code is not included)
To make the code run correctly with the SQL Backend I'm guessing that I need to provide the [ValCol] value however I have no Idea how to achieve this so any help would be gratefully received, maybe I need to take a completely different approach?
With Me.RecordsetClone
.ADDNEW
![ResultDate].Value = [T_RDate]
![RefType].Value = [RefType]
![QCRef].Value = [QCRef]
![Area].Value = [Area]
![TypeOfSample].Value = [TypeOfSample]
![Room].Value = [Room]
![Site].Value = [Site]
![Enteredby].Value = UCase(NetworkUserName())
' ![ValCol].Value = ?????????? ----------This is the part of the code I need help with
.Update
' 'Display the new duplicate.
Me.Bookmark = .LastModified
End With
Thank you in advance