Visible code Run Time problem in report

  • Thread starter Thread starter Breakingstein
  • Start date Start date
B

Breakingstein

Guest
I have a report which gets added to an e-mail. In Developer, the visible/invisible code which runs on the opening of the report works fine (it is really simple code), however, in Run-Time it just doesn't work! The fields which should switch their visiblility depending on the information in fields on a hidden form simply all stay visible!
Does anyone have any ideas why?
 
Use one of the On Format Events instead
 
Thanks

Thanks for replying, I shall try the On Format event and will also try to post the code I am talking about, however, it may take me a while to ensure that there is no confidential information contained within it! Would JosephWalter like the entire file in a ZIP file? Or would you prefer the code simply associated with the reports? Currently the code is within an On Open event of the report.
 
Code from Report

Hello,
This is the code from the report.

Rich - I tried the OnFormat event but to no avail. The same thing happens with all the fields remaining visible!
JosephWalter - If you would like to look at more of the code in the database to help, I shall try to chop some stuff out and bung it your way.

Thanks,
B




Private Sub Report_Open(Cancel As Integer)
Dim intHearingDays As Integer
Dim rptRef As Variant
On Error GoTo Error_Response 'Error trap

intHearingDays = Form_LISTING!hearingdays
rptRef = [Report_ESPAR-DLP-ALP-HMP Notification]

If [Form_CASE DETAILS]![TYPE OF CASE] = "ANNUAL REVIEW ESP" Then
[Report_ESPAR-DLP-ALP-HMP Notification]!ESPARtitle.Visible = True
Else
[Report_ESPAR-DLP-ALP-HMP Notification]!ESPARtitle.Visible = False
End If


If intHearingDays = 1 Then
With rptRef
!enddate.Visible = False
!between.Visible = False
!and.Visible = False
!on.Visible = True
End With
Else
With rptRef
!enddate.Visible = True
!between.Visible = True
!and.Visible = True
!on.Visible = False
End With
End If

Exit Sub
 

Users who are viewing this thread

Back
Top Bottom