Hello All
I have a listbox that I am trying to get the total $$ for a week from. I can total all of the records that appear in the listbox fine but when I total based on the week number it goes thru the code, and gets to IF statement and then even when the IF statement is true it skips over it.
Here is the code:
I have changed code around, I trade "Me" for forms!frmname!nowWk. When I was using the debugger I saw that the nowWk was 47, but that column 10 was "47". In the query that is used to fill the listbox, is using datepart("ww",[datename]) as column 10 so wouldn't that result be a numeric result not text?
any help would be appreciated.
Raven
I have a listbox that I am trying to get the total $$ for a week from. I can total all of the records that appear in the listbox fine but when I total based on the week number it goes thru the code, and gets to IF statement and then even when the IF statement is true it skips over it.
Here is the code:
Code:
Dim listsum As Double
Dim x As Integer
With Me.lstsummary
.Requery
For x = 0 To .ListCount
If Me.nowWk.Value = .Column(10, x) Then
listsum = listsum + Nz(.Column(12, x), 0)
End If
End With
Me.txttotweek.Value = listsum
I have changed code around, I trade "Me" for forms!frmname!nowWk. When I was using the debugger I saw that the nowWk was 47, but that column 10 was "47". In the query that is used to fill the listbox, is using datepart("ww",[datename]) as column 10 so wouldn't that result be a numeric result not text?
any help would be appreciated.
Raven