Referencing criteria form field values from reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I have a criteria form that takes a date range for a report.
What I want to do is that if the date range fields have not been entered
then I want some customised message (eg. No Date) on the report...
I have a txtbox on the report hearder and and here is how I am trying to
reference the date range fields...

="Between " &
IIf([Forms]![frmSalesCrit]![bDate].[HasData],[Forms]![frmSalesCrit]![bDate],"No
Date") & " And " &
IIf([Forms]![frmSalesCrit]![eDate].[HasData],[Forms]![frmSalesCrit]![eDate],"No Date")


But I can't seem to get it working, can someone help me out?
Thanks alot.
 
I changed it to the lines like shown below but I get #Name error. What am I
doing wrong?

="Between " & IIf(IsNull([Forms]![frmSalesCrit]![bDate]) Or
([Forms]![frmSalesCrit]![bDate]=""),[Forms]![frmSalesCrit]![bDate],"No Date")
&
" And " & IIf(IsNull([Forms]![frmSalesCrit]![eDate]) Or
([Forms]![frmSalesCrit]![eDate]=""),[Forms]![frmSalesCrit]![eDate],"No Date")
 
Try
="Between " & Nz([Forms]![frmSalesCrit]![bDate],"No Date") & " And " &
Nz([Forms]![frmSalesCrit]![eDate], "No Date")
 
Duane,
I did a copy and paste on your answer and I'm away grinning :-)
Thanks
--
niuginikiwi
Nelson, New Zealand


Duane Hookom said:
Try
="Between " & Nz([Forms]![frmSalesCrit]![bDate],"No Date") & " And " &
Nz([Forms]![frmSalesCrit]![eDate], "No Date")

--
Duane Hookom
MS Access MVP


niuginikiwi said:
Hi all,
I have a criteria form that takes a date range for a report.
What I want to do is that if the date range fields have not been entered
then I want some customised message (eg. No Date) on the report...
I have a txtbox on the report hearder and and here is how I am trying to
reference the date range fields...

="Between " &
IIf([Forms]![frmSalesCrit]![bDate].[HasData],[Forms]![frmSalesCrit]![bDate],"No
Date") & " And " &
IIf([Forms]![frmSalesCrit]![eDate].[HasData],[Forms]![frmSalesCrit]![eDate],"No
Date")


But I can't seem to get it working, can someone help me out?
Thanks alot.
 
Back
Top