G
Guest
Hi,
I am currently using the following function in my DB to add records into a
table;
Function Add_Tapes(strContract As String, strCustomer As String, strTapeID
As String, datIDate As Date, datRDate As Date)
Dim cDB As Database
Dim rTF As Recordset
Dim strTape As String
strTape = UCase(strTapeID)
Set cDB = CurrentDb
Set rTF = cDB.OpenRecordset("tabTapes")
With rTF
.AddNew
!ContractNumber = strContract
!Customer = strCustomer
!TapeID = strTape
!IDate = datIDate
!RDate = datRDate
!stamped = False
!Returned = False
.Update
.Close
End With
cDB.Close
End Function
I'd like to be able to change the above to amend the record if the TapeID
already exists or add a record if the TapeID does not exist. I have already
tried this using SQL based querires but as I have 20 different tapeid fields,
it just gets very complicated.
Can anyone help?
I am currently using the following function in my DB to add records into a
table;
Function Add_Tapes(strContract As String, strCustomer As String, strTapeID
As String, datIDate As Date, datRDate As Date)
Dim cDB As Database
Dim rTF As Recordset
Dim strTape As String
strTape = UCase(strTapeID)
Set cDB = CurrentDb
Set rTF = cDB.OpenRecordset("tabTapes")
With rTF
.AddNew
!ContractNumber = strContract
!Customer = strCustomer
!TapeID = strTape
!IDate = datIDate
!RDate = datRDate
!stamped = False
!Returned = False
.Update
.Close
End With
cDB.Close
End Function
I'd like to be able to change the above to amend the record if the TapeID
already exists or add a record if the TapeID does not exist. I have already
tried this using SQL based querires but as I have 20 different tapeid fields,
it just gets very complicated.
Can anyone help?