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!

Make control visible

Status
Not open for further replies.

humpydumpy2000

IS-IT--Management
Aug 18, 2016
30
PH
Hi all,

How can I make a control visible in a report if it is in
Page 1
else
it wont show at all.

Tried this code onload using this but the control shows in next page.

if(me.page = 1)then
me.ctrlName.visible = true
else
me.ctrlname.visible = false
end if

any thoughts?
thanks in advance :)
 
The code worked for me with Access 2016.

Did you try add a debug.print in the code to see what's going on?
Which event and section of the report did you add the code?
Which section of the report contains ctrlname?
Does your code compile?
Do you have a control bound to [Page]? I didn't need this.

Consider using TGML to post your code
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If (Me.Page = 1) Then
        Me.ctrlName.Visible = True
    Else
        Me.ctrlName.Visible = False
    End If
End Sub


Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top