R
Rob
I have had a problem for nearly a week now, and I am unable to decipher
it myself. The problem I am running in to, is that the DSum that my
button calls for, is not calculated until the current record (on a
continuous form) is defocused.
What I need is a way to force the DSum to update before the data is
sent to the table. I'm unsure of why it's not doing it currently, but
as it stands, the DSum will only visibly update on the form if I
defocus the current record.
Here is the code that I am using, any help would be greatly
appreciated.
------
Private Sub Command12_Click()
Dim rsCurr As DAO.Recordset
Dim strSQL As String
Dim nHours As Integer
Dim nMinutes As Integer
Dim nTotal As Date
Dim nXfer As Integer
Returned.Value = Time
nTotal = CheckedOut.Value - Returned.Value
nHours = DatePart("h", nTotal)
nMinutes = DatePart("n", nTotal)
nXfer = (nHours * 60) + nMinutes
TotalTime.Value = nXfer
TotalMinBox.Value = DSum("TotalTime", "LearnerActivity", "[IDNumber]="
& IDNumber)
strSQL = "SELECT TotalMinutes " & "FROM LearnerInformation " & "WHERE
IDNumber = " & Me.IDNumber
Set rsCurr = CurrentDb().OpenRecordset(strSQL)
If Not rsCurr.EOF Then
rsCurr.Edit
rsCurr![TotalMinutes] = TotalMinBox.Value
rsCurr.Update
End If
End Sub
--------
P.S., I did have a previous topic going where I posted this issue,
however the title was the name of the problem I had prior to this. I
hope reposting this as a more relevant term will not be troublesome.
Thanks again.
it myself. The problem I am running in to, is that the DSum that my
button calls for, is not calculated until the current record (on a
continuous form) is defocused.
What I need is a way to force the DSum to update before the data is
sent to the table. I'm unsure of why it's not doing it currently, but
as it stands, the DSum will only visibly update on the form if I
defocus the current record.
Here is the code that I am using, any help would be greatly
appreciated.
------
Private Sub Command12_Click()
Dim rsCurr As DAO.Recordset
Dim strSQL As String
Dim nHours As Integer
Dim nMinutes As Integer
Dim nTotal As Date
Dim nXfer As Integer
Returned.Value = Time
nTotal = CheckedOut.Value - Returned.Value
nHours = DatePart("h", nTotal)
nMinutes = DatePart("n", nTotal)
nXfer = (nHours * 60) + nMinutes
TotalTime.Value = nXfer
TotalMinBox.Value = DSum("TotalTime", "LearnerActivity", "[IDNumber]="
& IDNumber)
strSQL = "SELECT TotalMinutes " & "FROM LearnerInformation " & "WHERE
IDNumber = " & Me.IDNumber
Set rsCurr = CurrentDb().OpenRecordset(strSQL)
If Not rsCurr.EOF Then
rsCurr.Edit
rsCurr![TotalMinutes] = TotalMinBox.Value
rsCurr.Update
End If
End Sub
--------
P.S., I did have a previous topic going where I posted this issue,
however the title was the name of the problem I had prior to this. I
hope reposting this as a more relevant term will not be troublesome.
Thanks again.