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

First record code not running

Status
Not open for further replies.

dmkennard2

Technical User
Jun 11, 2004
101
GB
Hi,
I have two text boxes on a report that i show and hide depending on a value of a tickbox. The code below works for every record apart from the first record if the value is true. Both boxes properties are set to invisible, but if i enable them they show all the time on the first page.

Do i need to refresh the report when it first opens to make he code run for the first record? If so what is the best way, i have tried?

Code:
Private Sub Report_Page()

If [ConOpen_Closed].Value = True Then
    lblClosed.Visible = True
        ConDate_Closed.Visible = True
Else

lblClosed.Visible = False
    ConDate_Closed.Visible = False
End If

End Sub

Thanks in advance
Dazz
 
Is there a good reason why you put the code in the Page event? I would have the code in the Format event of the report section containing ConDate_Closed.

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]
 
No reason, just my lack of knowledge. :)
I moved it to the format area and it works, Thank you.

Dazz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top