I have a form for users to enter criteria for queries & reports that has 12 text boxes that are either enabled or disabled depending on a dlookup from my Reports table based on the report name.
I then have various command buttons so each report can either be printed, previewed, exported to Excel, exported to PDF, etc, etc.
I need some code so that when I click to run the report, it checks all 12 fields to see which ones are enabled and if so, check on those enabled fields to make sure that the user has entered some information in.
I have come up with this so far but getting error 438 Object doesn't support this property or method (If ctl.Enabled = True Then)
I've tried searching this site and google but i keep getting swamped with results on how to do basic data validation.
Any help would be greatly appreciated
I then have various command buttons so each report can either be printed, previewed, exported to Excel, exported to PDF, etc, etc.
I need some code so that when I click to run the report, it checks all 12 fields to see which ones are enabled and if so, check on those enabled fields to make sure that the user has entered some information in.
I have come up with this so far but getting error 438 Object doesn't support this property or method (If ctl.Enabled = True Then)
Code:
[FONT=Arial]Dim ctl As Control[/FONT]
[FONT=Arial]For Each ctl In Me.Controls[/FONT]
[FONT=Arial]If ctl.Enabled = True Then[/FONT]
[FONT=Arial] If ctl = "" Then[/FONT]
[FONT=Arial] MsgBox "You must enter all criteria required " [/FONT]
[FONT=Arial] GoTo Err_ReportExcel_Exit[/FONT]
[FONT=Arial] End If[/FONT]
[FONT=Arial]End If[/FONT]
[FONT=Arial]Next ctl[/FONT]
I've tried searching this site and google but i keep getting swamped with results on how to do basic data validation.
Any help would be greatly appreciated