[AccessD] If-Then in a report

Stuart McLachlan stuart at lexacorp.com.pg
Fri Jun 13 06:30:35 CDT 2003


On 12 Jun 2003 at 23:03, Kathryn Bassett wrote:

> Thanks again to Stuart, my report is almost exactly what I want (except final lining up etc):
> http://altadenabaptist.org/images/Image2.jpg
> 
> Next, I want to know how to make the Connections *label* to only show up if there is content in the field.
> Going back to the image that shows the layout:
> http://altadenabaptist.org/images/Image1.jpg
> you can see how it's set at present. I know how to trim in the content, but not how to make the label appear/disappear. My thoughts are:
> If the field called "connections" is not blank, then print Connections followed by a colon and then a space, and then the contents of the Connections field.
> I'm guessing it is done by somehow using the trim (& not using the label), but can't figure out the exact syntax.
> I tried this:
> =trim(Connections: & " " & [connections])
> but it tells me I've entered an operand without an operator.
> 
> I need the correct syntax, and also need to know if I'm right that if the connections field is empty, it will not put anything, including the Connections: or is there some other solution?
> 
Looks like Label17 is not tied to the connections field. In that 
case.

in your Detail_format() put:

If connections < " " then
  connections.visible = false
  label17.visible = false
else
  connections.visible = true
 label17.visible  = true
end if

or if connections can be null you need
if nz(connections,"") < " " 


-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the AccessD mailing list