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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Controls on Report

Status
Not open for further replies.

Lightning

Technical User
Jun 24, 2000
1,140
0
0
AU
I have a report which is a govt prescribed format. Depending upon certain criteria, some of the paragraphs need to be ruled through.

I have set the report up by setting line controls over each of the paragraphs and tried using a Select Case statement to set the appropriate lines' visible property to false. However, the line controls very unreasonably refuse to co-operate by becoming invisible. Can anyone suggest what I'm doing wrong? The code I'm using is

Code:
Select Case [NTVCode]
       Case [NTVCode] = 1
           [Line89].Visible = False
           [Line90].Visible = False
        Case [NTVCode] = 2
           [Line54].Visible = False
           [Line55].Visible = False
           [Line56].Visible = False
       Case [NTVCode] = 3
           [Line57].Visible = False
           [Line58].Visible = False
    End Select

Thanks in advance
Lightning X-)
[sig][/sig]
 
Lightening,

The code at-a=glance test says it is O.K.

How/where/when is it invoked?

How is NTVCode set? What is it's value when the posted code is executed?


[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Hi Michael

The process starts from a data form. A command button is clicked which runs a query to print the current record, including information from the main table and two other tables. NTVCode is a field on the form/in the table, and has valid values of 1, 2 or 3 only. These values are set dependent on the content of a &quot;reason for action&quot; field also on the form/in the table.

When the query is run the report opens in preview mode. The code is invoked in the Report Activate property.

The value of NTVCode is passing to the report correctly, so the problem is not in the value not being able to be read. (At least, I assume that's not the problem.)

The only other clue I have now is that when I re-wrote the code to ensure I hadn't made any mistakes, I noticed that the option list for the line controls in the code window does not include the Visible property, even though this property appears in the property sheet in design view. This appears to be a contradiction within Access. If I can set the property in design view, surely I can set it in code!

I should probably mention that I'm using Access97, not 2000.

Thanks for your time and help.

Lightning [sig][/sig]
 
Lightining,

??? something is awry ???

In my version of Ms. Access, the line control property is shown in the properties box when the line is selected in design view.

As for a contradiction within Ms. Access, there are a number of (control) properties which are available in restricted circumstances (design view, run time, in code only ...)

I think the problem is in the &quot;where&quot; clause. If the property is set in the &quot;Activate&quot; event, the current record is not (yet) available, so when it does become available, the property is &quot;re-set&quot; according to the static (design view) property. Any property setting which applies to a specific record probably needs to be in the &quot;On Current&quot; event.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top