R
Rob
I receive run-time error #2465 when I compile the following code :
Run-time error '2465':
Microsoft Office Access can't find the field '|' referred to in your
expression.
---------------------------------
Private Sub Command12_Click()
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
[Tables]![LearnerInformation]![TotalMinutes] = nXfer
End Sub
-----------------------------------
The debugger highlights the line
"[Tables]![LearnerInformation]![TotalMinutes] = nXfer"
I'm quite sure that I have spelled everything perfectly and it all
matches the appropriate tables.
If there's not an obvious syntax error here, you can read the rest of
this and perhaps get some insight as to what I'm doing, and maybe even
suggest better code for me.
I have a form (with this button on it) that holds periods of time
people are 'logged in.' The date format (hh:mm) is then converted in to
minutes only, and stored (nXfer). Whenever the logged in time is
updated (done by pressing this button), I want it to shoot the data
(nXfer) over to the user's profile underneath the "TotalMinutes" field
in the LearnerInformation table.
If there's any more info needed, I will gladly provide it.
I appreciate any help, and thank you in advance.
Run-time error '2465':
Microsoft Office Access can't find the field '|' referred to in your
expression.
---------------------------------
Private Sub Command12_Click()
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
[Tables]![LearnerInformation]![TotalMinutes] = nXfer
End Sub
-----------------------------------
The debugger highlights the line
"[Tables]![LearnerInformation]![TotalMinutes] = nXfer"
I'm quite sure that I have spelled everything perfectly and it all
matches the appropriate tables.
If there's not an obvious syntax error here, you can read the rest of
this and perhaps get some insight as to what I'm doing, and maybe even
suggest better code for me.
I have a form (with this button on it) that holds periods of time
people are 'logged in.' The date format (hh:mm) is then converted in to
minutes only, and stored (nXfer). Whenever the logged in time is
updated (done by pressing this button), I want it to shoot the data
(nXfer) over to the user's profile underneath the "TotalMinutes" field
in the LearnerInformation table.
If there's any more info needed, I will gladly provide it.
I appreciate any help, and thank you in advance.