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

Accurately detecting wether a subreport has data 2

Status
Not open for further replies.

Minkers

Technical User
Dec 15, 2004
70
US
I need a method for accurately detecting wether a subform has data. If a certain subform has no data, parts of the main form will appear. If that subform has data, parts of the main form will be invisible.

Please help!
Minkers
 
It is true that the code that you posted works, but how do I code the second subform, which continues with the rest of the entries past the first three if I am not using the top three query?
 
If you want to show the 4th and greater in the second subreport, your code would be
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Cancel = Me.txtCount <= 3
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]
 
Good answer, it was one of those that make me wonder why I didn't think of it. Problem is, when there are less then three records to be split between the two subforms, it shows the records on the first page, and the header for the second subform on the second page. Why would it be doing that?
 
It is showing the header because there is nothing that says it shouldn't display.

You should be able to write code that determines the total number of records and cancels the display of the section that you don't want to see.

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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top