S
Sammie
I have a command button on a form that creates a new record in another
table. After this is done, I want to update the value of another field
on the new record I just created by copying the value from one field to
another.
My table is called TakeaNumber. It has an autonumber field called
SalesOrderID. I want to copy the value of the [Salesorderid] field
(this is a number field) to the [invoice #] field (this is a text
field). Below is my code to add the new record. Can someone help me
with the additional code to do this?
'Create new Invoice based on this quote.
Dim dbsSuperdatabase As Database
Dim rstTakeaNumber As DAO.Recordset 'table to be updated
'Dim strSQL As String
Set dbsSuperdatabase = CurrentDb
Set rstTakeaNumber = dbsSuperdatabase.OpenRecordset("TakeaNumber")
rstTakeaNumber.AddNew
rstTakeaNumber![Client] = Me![Client]
rstTakeaNumber![Quote#] = Me![Quote#]
rstTakeaNumber![ShipmentID] = Me![ShipmentID]
rstTakeaNumber.Update
rstTakeaNumber.close
Set rstTakeaNumber = Nothing
table. After this is done, I want to update the value of another field
on the new record I just created by copying the value from one field to
another.
My table is called TakeaNumber. It has an autonumber field called
SalesOrderID. I want to copy the value of the [Salesorderid] field
(this is a number field) to the [invoice #] field (this is a text
field). Below is my code to add the new record. Can someone help me
with the additional code to do this?
'Create new Invoice based on this quote.
Dim dbsSuperdatabase As Database
Dim rstTakeaNumber As DAO.Recordset 'table to be updated
'Dim strSQL As String
Set dbsSuperdatabase = CurrentDb
Set rstTakeaNumber = dbsSuperdatabase.OpenRecordset("TakeaNumber")
rstTakeaNumber.AddNew
rstTakeaNumber![Client] = Me![Client]
rstTakeaNumber![Quote#] = Me![Quote#]
rstTakeaNumber![ShipmentID] = Me![ShipmentID]
rstTakeaNumber.Update
rstTakeaNumber.close
Set rstTakeaNumber = Nothing