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

"Me.Detail.Visible = True" NOT WORKING!!

Status
Not open for further replies.

djayam

Technical User
Aug 16, 2005
95
GB
Hi guys,

I have a really basic table of team players (ID, PlayerName). I have built a report with tbl_Players.PlayerName in the detail section. When I run the report I get the full list - as expected.

Now, I add the following code to the OnFormat property of the detail section:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.Visible = False
End Sub

I would expect this to supress all detail records - correct? It doesn't, all detail records are shown.

Before you ask WHY on Earth I'd want to do this it is a test as I have tried to conditionally supress the detail section in another report but that's not working either. So I tried it on a really basic one...

Any ideas? I am using Access 2007.

Cheers,

Jason
 
Tried that too - doesn't work either!
 
Try this:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Cancel = True
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Nope - doesn't work either. This is really weird! Just in case there was something strange happening inside my db I have created a new one - single table, 2 fields only and tried again, Still doesn't work.

I'm sure it should - anything new in Ac2007 that might be different?
 
You are not going to believe this! I'm really sorry guys but I'm still getting used to Access 2007. I was happily pressing what I thought was the Preview Button but it was the Report View button! Do a print preview and it is working after all!!

Sorry guys - thanks for your efforts though!

Jason (embarrassed)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top