HI,
I am trying to save myself the work of creating 2 reports and 2 separate queries for the sake of one field.
On one of my forms, I have added a button to export a report of the information on the form. The report has a field 'ManagementDeliverability' which won't always be completed in the relevant form. However, I don't want the field to appear blank on the occasion when it isn't completed but I need to keep it in the report for the occasions when it is. I have been trying to add "N/A" to the field when the report is exported but I am struggling to make this work. I have tried a few different methods based on what I have done in the past and based on some of the other threads in the forum and I'm not sure where I am going wrong.
I added
I also tried this as a separate expression in a new query column. This gave me a completed report but the field was still blank and "N/A" wasn't added. I then left this as a separate expression, unticked the 'show' box and added
I have tried adding this to the control source on the report but get the #Size! error.
I was wondering whether it would be better to use VBA but I wouldn't know where to start. The code currently behind the button is:
Any help would be very much appreciated.
I am trying to save myself the work of creating 2 reports and 2 separate queries for the sake of one field.
On one of my forms, I have added a button to export a report of the information on the form. The report has a field 'ManagementDeliverability' which won't always be completed in the relevant form. However, I don't want the field to appear blank on the occasion when it isn't completed but I need to keep it in the report for the occasions when it is. I have been trying to add "N/A" to the field when the report is exported but I am struggling to make this work. I have tried a few different methods based on what I have done in the past and based on some of the other threads in the forum and I'm not sure where I am going wrong.
I added
IIf(IsNull([Forms].[GrantsF].[ManagementDeliverability]),"N/A",[ManagementDeliverability]) in the criteria for the 'ManagementDeliverability' field in the query. This gave me a blank report.I also tried this as a separate expression in a new query column. This gave me a completed report but the field was still blank and "N/A" wasn't added. I then left this as a separate expression, unticked the 'show' box and added
<>False to the criteria and got the same result. I have tried adding this to the control source on the report but get the #Size! error.
I was wondering whether it would be better to use VBA but I wouldn't know where to start. The code currently behind the button is:
Code:
DoCmd.OutputTo acOutputReport, "EnglandApplicationCopySub", acFormatPDF, "\Database\Reports\" & "Grant URN" & " " & Me.GrantURN & " " & Format(Date, "dd mm yyyy") & ".pdf", True
Any help would be very much appreciated.