|
-
Mar 22nd, 2006, 04:40 AM
#1
Thread Starter
New Member
Changing fields on Datareport
I have designed a datareport with VB6. With a query I deside which info I will display on the report.
There is a field named Primary_address, this field is an integer field.
His value can be 0,1,2,3.... etc. When the value is 0, I will display
a text in the report. How can I do that? I used the code below.
VB Code:
Dim rsDutten As ADODB.Recordset
Set rsDutten = New ADODB.Recordset
rsDutten.CursorType = adOpenKeyset
rsDutten.LockType = adLockOptimistic
rsDutten.ActiveConnection = cnParm
rsDutten.Source = "SELECT Type, Benaming, Fabrikant, Datum,
Revisie_proc, Aktief, Driver, Primary_address, Secondary_address FROM
dutten WHERE Station = '" & Station & "' ORDER BY Type;"
rsDutten.Open
Set DataReport2.DataSource = rsDutten
DataReport2.Orientation = rptOrientLandscape
DataReport2.Show
-
Mar 22nd, 2006, 05:25 AM
#2
Hyperactive Member
Re: Changing fields on Datareport
place a label control in the data report. in my code it is label 3 and the section in section5
if rsDutten("Primary_address").value="0" then
DataReport2.Sections("Section5").Controls("Label3").Caption = "test"
end if
This will work only for displaying a single record. If ur displaying multiple record the value will be the same. i have tried this a lot.
I think u need to try it in sql to do so.
if u got the solution pls let me know
-
Mar 22nd, 2006, 06:48 AM
#3
Re: Changing fields on Datareport
Moved to reporting section
-
Mar 22nd, 2006, 06:07 PM
#4
Thread Starter
New Member
Re: Changing fields on Datareport
I will display multiple records in a section. I don't know how I handle my wish in a query. Does somebody know how?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|