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

Visible controls on report from Parameters 2

Status
Not open for further replies.

gRegulator

Technical User
Jul 3, 2003
133
CA
Hi,

I have a Report named 'Clinic: Adult Cardiology'. When the report is opened, the user is prompted for parameters specifying the beginning and ending dates of the study period, in a form named frmParameter8. The names of the combo boxes in which the parameters are input are cboBegin (for beginning date) and cboEnd (for ending date). I have decided to include on the form, a label and text control which I would like to be visible when there is input in the date parameters, but to be invisible when these parameters are left null. I have placed this code in the On Activate option of my report, but the problem is that it keeps both controls invisible all the time. Does anyone know what may be the problem? Thanks!!

Private Sub Report_Activate()
DoCmd.Maximize

Label21.Visible = False
Text33.Visible = False

Select Case Forms!frmParameter8!cboBegin
Case Not Null
Label21.Visible = True
Text33.Visible = True
Case Else
Label21.Visible = False
Text33.Visible = False
End Select

End Sub
 
Sorry, the label and text control are on the REPORT not the form. I hope I didn't confuse anyone...
 
hey gRegulator.

try this...

Include only the code below in your activate proc.

'''''''''

If IsNull(Forms!frmParameter8!cboBegin) Then
Me!Text33.Visible = False
Me!Label21.Visible = False
Else
Me!Text33.Visible = True
Me!Label21.Visible = True
End If

'''''''''

hope this helps you.
 
If that doesn't work, try moving your code to the On Format event of the section where your label and text box reside....



A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
Douglas Adams
 
cghoga,

I can't believe it was that simple!! Thanks so much for your time and help!!

Greg
 
Cosmo, Thanks for your suggestion as well, luckily the first one worked though...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top