Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Concatenate to reference an existing db field?

Status
Not open for further replies.

ReportHacker

Programmer
Apr 25, 2000
7
US
Hi,

I have some database fields that may or may not have data, and I
have two columns with 10 rows in the detail section of the report (20 spots).
The database fields look like: {pxdcr_data.Press1}, {pxdcr_data.Press2},
up to 20 of these. I would like to generate 20 formulas ("@OutPress1",
"@OutPress2", etc..) for each "spot" in the detail. With any situation where
there may be no data for "{pxdcr_data.Press1}", but there is data for
"{pxdcr_data.Press2}", I would like to put the data from"{pxdcr_data.Press2}"
into spot #1. So basically-there isn't any spaces of displayed data in the 10 rows
(or columns) in the detail.

I would like to try a Basic syntax of something like this (this would be
in the 1st spot):

Dim i As Number
Dim x As Number
Dim name As String
x=1 'Set this to the Pressure xducer value (spot) to be displayed

For i=1 to 20

name = "{pxdcr_data.Press" & i & "}"

IF IsNull(name) = False Then
IF i = x Then
formula=name
End If
End IF

Note: the database fields are single precision data (numerics), with default = Null

So I would place this same formula in each of the 20 spots (formulas)
and change the value of x (noted above) corresponding to the formula number(or spot) like: @OutPress1, @OutPress2, etc...


Question: What am I doing wrong ???? What is a better solution ????


I thank you for your help on this one ..

Sincerely,

Karl H.
 
Hi,

if you just add each of the fields into a new line in a text field then you can set to format option to suppress blank lines.

Geoff

PS. If the null values cause a problem then just use the formulae you were going to create, eg...

if isnull({field} then "" else {field}

and add the formulae to the text field

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top