LittleNick
Technical User
Hi,
I have a SQl table named tblTransaction that keep track of the change in value on several of the textboxes. This table has now cumulated about 700,000 records. Below is the codes of one of the textbox After Update Event:
Private Sub ShipDay_AfterUpdate()
Dim StrSQL As String
Dim cnnTest As New ADODB.Connection
Dim rstRS As New ADODB.Recordset
StrSQL = "Select * from tblTransactions"
Set cnnTest = CurrentProject.Connection
Set rstRS = New ADODB.Recordset
rstRS.Open StrSQL, cnnTest, adOpenDynamic, adLockOptimistic
rstRS.MoveLast
rstRS.AddNew
rstRS("patientid") = Me.ID.Value
rstRS("datestamp") = Now()
rstRS("Application") = "Order"
rstRS("ItemChanged") = "ShipDay"
rstRS("ValueBefore") = varShipDay
rstRS("ValueAfter") = Me.ShipDay
rstRS.Update
rstRS.Close
End Sub
The problem I have is it take a while to execute. Can someone tell me if there is a way to make this run faster?
Thanks in advance for helps
I have a SQl table named tblTransaction that keep track of the change in value on several of the textboxes. This table has now cumulated about 700,000 records. Below is the codes of one of the textbox After Update Event:
Private Sub ShipDay_AfterUpdate()
Dim StrSQL As String
Dim cnnTest As New ADODB.Connection
Dim rstRS As New ADODB.Recordset
StrSQL = "Select * from tblTransactions"
Set cnnTest = CurrentProject.Connection
Set rstRS = New ADODB.Recordset
rstRS.Open StrSQL, cnnTest, adOpenDynamic, adLockOptimistic
rstRS.MoveLast
rstRS.AddNew
rstRS("patientid") = Me.ID.Value
rstRS("datestamp") = Now()
rstRS("Application") = "Order"
rstRS("ItemChanged") = "ShipDay"
rstRS("ValueBefore") = varShipDay
rstRS("ValueAfter") = Me.ShipDay
rstRS.Update
rstRS.Close
End Sub
The problem I have is it take a while to execute. Can someone tell me if there is a way to make this run faster?
Thanks in advance for helps