Sun value in Report.

theinviter

Registered User.
Local time
Today, 04:54
Joined
Aug 14, 2014
Messages
273
Dears;
i have created inventory report with filed (in and Out) in one column as i want to get the vale of record has In and record has Out.
when i tried this =Sum([Balance]) it will sum all record.
as the filter field is "Stock_L"
so how to do in the report .
 
Perhaps a little bit more detail about what you expect in this report would be useful.

Start by explaining this, please. "...as the filter field is "Stock_L""

Are you saying that you want only records where the value "Stock-L" appears in some specific field in the table? If so, we need the name of that specific field.
 
Perhaps a little bit more detail about what you expect in this report would be useful.

Start by explaining this, please. "...as the filter field is "Stock_L""

Are you saying that you want only records where the value "Stock-L" appears in some specific field in the table? If so, we need the name of that specific field.
"Stock_L"" = is dr0p list has (in & out)
yes I need the sum of record only when stock_L = "in" and sum of record if stock_L = "out"
the value present in field " Stock_Count"
 
last time i say you are using Dsum() from another thread to calculate the balance?
use same DSum() expression in your report.
 
last time i say you are using Dsum() from another thread to calculate the balance?
use same DSum() expression in your report.
hi
the balance present in " Stock_Count" , so i need sum of IN and out .
find attached picture
 

Attachments

  • dsum.png
    dsum.png
    166.9 KB · Views: 82
you can use Current event of your form/subform:
Code:
private sub form_current()
dim dblIn as double
dim dblOut as balance
with me.recordsetclone
    if not (.bof and .eof) then
        .movefirst
    end if
    do until .eof
        if ![Stock_L] = "IN" then
            dblIn = dblIn + Nz(!Stock_Count, 0)
        ElseIf ![Stock_L] = "OUT" then
            dblOut = dblOut + Nz(!Stock_Count, 0)
        end if
        .movenext
     loop
end with
me!txtboxTotalIn = dblIn
me!txtboxTotalOut = dblOut
end sub
 
you can use Current event of your form/subform:
Code:
private sub form_current()
dim dblIn as double
dim dblOut as balance
with me.recordsetclone
    if not (.bof and .eof) then
        .movefirst
    end if
    do until .eof
        if ![Stock_L] = "IN" then
            dblIn = dblIn + Nz(!Stock_Count, 0)
        ElseIf ![Stock_L] = "OUT" then
            dblOut = dblOut + Nz(!Stock_Count, 0)
        end if
        .movenext
     loop
end with
me!txtboxTotalIn = dblIn
me!txtboxTotalOut = dblOut
end sub
Can yli apply this on report.
 
on the Load event or
Format Event of the Detail section.
 
you can use Current event of your form/subform:
Code:
private sub form_current()
dim dblIn as double
dim dblOut as balance
with me.recordsetclone
    if not (.bof and .eof) then
        .movefirst
    end if
    do until .eof
        if ![Stock_L] = "IN" then
            dblIn = dblIn + Nz(!Stock_Count, 0)
        ElseIf ![Stock_L] = "OUT" then
            dblOut = dblOut + Nz(!Stock_Count, 0)
        end if
        .movenext
     loop
end with
me!txtboxTotalIn = dblIn
me!txtboxTotalOut = dblOut
end sub
i tried but got this error , as in attached file .
 

Attachments

  • err11.png
    err11.png
    44.6 KB · Views: 74
change to:

Dim dblOut As Double
 
can you upload your db, so i can apply?
 
check and test.
thanks alot., i tried this but has some issue, when i select from drop list sometime hang and close the application, also when i add any number.
but i want Date Filter field to be blank ( as user can select).
 
somewhere there is already a "stock card - copy(2) on my pc. therefore this is not the latest.
and i think i already upload copy(2) also.
 

Users who are viewing this thread

Back
Top Bottom