Simple problem

snoopy22

Registered User.
Local time
Today, 09:32
Joined
Oct 1, 2004
Messages
45
Hello everyone

I've got a report, on it open event I used the following code:

Private Sub Report_Open(Cancel As Integer)

Me.RecordSource = "select * from transaction where Name _
= " & """" & Forms!printre.MyFilter _
& """" & " and [Date] > #" & Forms!printre.MyDate & "#"
End Sub

It works fine. my problem is this:

I want to add a label which will be depand on a value from a field in the table.
for example. let's say the value is on the balance field on transaction table.
I want to write something like this:


if rs.balance>0 then
label.caption= " you're above 0 "
else
label.caption= " you're below zero"

my question is: what do I write, and where?
 
Thanks

It works, and now for another question (:
How can I define the "page footer" of my report
to be one line below the last row of my report.
I put the label on the "page footer" and The defualt of the "page footer" is to display it on the bottom.

I've already asked it in another forum, and someone told me:

IF you are Grouping data in a report, put the Label in the Group Footer

Here is a workaround if you are NOT using Grouping in your report, go to the RecordSource for your report and add a calculated field such as Junk: " "

Group on the Value of Junk ... and use a "Group Footer" ... put the label in the "group footer"

Note: a page footer will always be at the bottom of a page


What is to "group"? did he refer to the Sql command?
also, what is a calculated field?
should I change the recordsource like that:

"select * from transaction where ....group by something "
 

Users who are viewing this thread

Back
Top Bottom