Posted 8 January 2020, 12:45 pm EST - Updated 30 September 2022, 8:22 am EST
Hello. Somewhat of a novice with ActiveReports scripting. I have a nested If Statement that I just cant see to get to work… I have TextBox10 displayed on my report, and the values are the same, yet it’s still adding 1 for every Detail record. Basically, I am trying to do a DCount in scripting but based on a date parameter. The date part works, the TextBox9 is updating appropriately, but TextBox8 is still being incremented for EACH Detail, even if the currTransNum =s prevTransNum.
Sub Detail_Format
dim prevTransNum as string
dim currTransNum as string
currTransNum = me.txtSTOStockTransferNumber.value
if me.txtSTODate.value < DateAdd("d", -15, Date.Today) then
if currTransNum <> prevTransNum then
Me.TextBox8.value = Me.TextBox8.value + 1
prevTransNum = currTransNum
End If
Me.TextBox9.Value = Me.TextBox9.value + Me.txtSTOQtyOpen.value
end if
me.TextBox10.value = prevTransNum
What am I doing wrong? Please see attachment where you can see the data… hope this makes sense