Date Parameter on Report

K

Kathy

Hello...I am using the code below to show a date parameter on a report. The
parameters are entered via a form...frmStaffFollowUp. It works well, except I
am trying to make a small change to no avail. When there are No Records
Found, I would still like the date parameter to show...something like "No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far eveything
that I have stabbed at has returned #Error. Any help is greatly appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 
K

Ken Snell \(MVP\)

Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])
 
K

Kathy

Thank you for your reply...your suggestion looks like it should completely
solve the problem, but I am still receiving #Error when there are no records
found. (If there are records, then the date parameter returns accurately.)
Thus I double-checked everything, but still got the same result when there
are no records. So I separated into two text boxes. One is a text box which
displays the parameter dates...no IIF statement involved. Then another text
box directly underneath displays the following:

IIf(Report.HasData, " ", "No Records Found").

This arrangement is working, but just frustrating as it should work as you
suggested in your reply. If you have any other thoughts, I would appreciate
hearing from you.
Thanks again.


--
Kbelo


Ken Snell (MVP) said:
Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])

--

Ken Snell
<MS ACCESS MVP>




Kathy said:
Hello...I am using the code below to show a date parameter on a report.
The
parameters are entered via a form...frmStaffFollowUp. It works well,
except I
am trying to make a small change to no avail. When there are No Records
Found, I would still like the date parameter to show...something like "No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far eveything
that I have stabbed at has returned #Error. Any help is greatly
appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " &
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 
K

Ken Snell \(MVP\)

Hmm... strange result. In which section of the report is the textbox
located -- the one that you want to display the info per the solution that
I'd posted?

--

Ken Snell
<MS ACCESS MVP>


Kathy said:
Thank you for your reply...your suggestion looks like it should completely
solve the problem, but I am still receiving #Error when there are no
records
found. (If there are records, then the date parameter returns accurately.)
Thus I double-checked everything, but still got the same result when there
are no records. So I separated into two text boxes. One is a text box
which
displays the parameter dates...no IIF statement involved. Then another
text
box directly underneath displays the following:

IIf(Report.HasData, " ", "No Records Found").

This arrangement is working, but just frustrating as it should work as you
suggested in your reply. If you have any other thoughts, I would
appreciate
hearing from you.
Thanks again.


--
Kbelo


Ken Snell (MVP) said:
Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " &
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])

--

Ken Snell
<MS ACCESS MVP>




Kathy said:
Hello...I am using the code below to show a date parameter on a report.
The
parameters are entered via a form...frmStaffFollowUp. It works well,
except I
am trying to make a small change to no avail. When there are No Records
Found, I would still like the date parameter to show...something like
"No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far
eveything
that I have stabbed at has returned #Error. Any help is greatly
appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - "
&
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 
K

Kathy

Hello again...the textbox is in the header section of the report. When I used
your code there, it worked if there were records or if I removed the second
reference to the date parameter and just had "No Records Found"...then it
would work too. Just seemed like it glitched on the second date reference and
thus would not return: No Records found for 1/1/2000 - 1/1/2001 (as example).
I even tried to build another TestReport to see if there was something in my
current report that could cause the glitch...but I had the same error.
Logically, your suggestion should work, but just not happening. Again I
appreciate your help. (I can live with this result, if it looks like we have
reached an impasse, but still willing to try other suggestions.)
--
Kbelo


Ken Snell (MVP) said:
Hmm... strange result. In which section of the report is the textbox
located -- the one that you want to display the info per the solution that
I'd posted?

--

Ken Snell
<MS ACCESS MVP>


Kathy said:
Thank you for your reply...your suggestion looks like it should completely
solve the problem, but I am still receiving #Error when there are no
records
found. (If there are records, then the date parameter returns accurately.)
Thus I double-checked everything, but still got the same result when there
are no records. So I separated into two text boxes. One is a text box
which
displays the parameter dates...no IIF statement involved. Then another
text
box directly underneath displays the following:

IIf(Report.HasData, " ", "No Records Found").

This arrangement is working, but just frustrating as it should work as you
suggested in your reply. If you have any other thoughts, I would
appreciate
hearing from you.
Thanks again.


--
Kbelo


Ken Snell (MVP) said:
Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " &
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])

--

Ken Snell
<MS ACCESS MVP>




Hello...I am using the code below to show a date parameter on a report.
The
parameters are entered via a form...frmStaffFollowUp. It works well,
except I
am trying to make a small change to no avail. When there are No Records
Found, I would still like the date parameter to show...something like
"No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far
eveything
that I have stabbed at has returned #Error. Any help is greatly
appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " - "
&
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 
K

Ken Snell \(MVP\)

I've tested the IIf expression with the textbox in the report header section
or in the page header section. Both locations work without giving me an
#Error in that textbox.

I do note a syntax error in your IIf expression, now that I study it more
carefully. Try it this way (without the [ ] characters around the reference
to the form's controls):

=IIf(Report.HasData,Forms!frmStaffFollowUp!txtStartDate & " " & " - " & "
" & Forms!frmStaffFollowUp!txtEndDate,"No Records Found for " &
Forms!frmStaffFollowUp!txtStartDate & " " & " - " & "
" & Forms!frmStaffFollowUp!txtEndDate)

--

Ken Snell
<MS ACCESS MVP>



Kathy said:
Hello again...the textbox is in the header section of the report. When I
used
your code there, it worked if there were records or if I removed the
second
reference to the date parameter and just had "No Records Found"...then it
would work too. Just seemed like it glitched on the second date reference
and
thus would not return: No Records found for 1/1/2000 - 1/1/2001 (as
example).
I even tried to build another TestReport to see if there was something in
my
current report that could cause the glitch...but I had the same error.
Logically, your suggestion should work, but just not happening. Again I
appreciate your help. (I can live with this result, if it looks like we
have
reached an impasse, but still willing to try other suggestions.)
--
Kbelo


Ken Snell (MVP) said:
Hmm... strange result. In which section of the report is the textbox
located -- the one that you want to display the info per the solution
that
I'd posted?

--

Ken Snell
<MS ACCESS MVP>


Kathy said:
Thank you for your reply...your suggestion looks like it should
completely
solve the problem, but I am still receiving #Error when there are no
records
found. (If there are records, then the date parameter returns
accurately.)
Thus I double-checked everything, but still got the same result when
there
are no records. So I separated into two text boxes. One is a text box
which
displays the parameter dates...no IIF statement involved. Then another
text
box directly underneath displays the following:

IIf(Report.HasData, " ", "No Records Found").

This arrangement is working, but just frustrating as it should work as
you
suggested in your reply. If you have any other thoughts, I would
appreciate
hearing from you.
Thanks again.


--
Kbelo


:

Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " -
" &
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])

--

Ken Snell
<MS ACCESS MVP>




Hello...I am using the code below to show a date parameter on a
report.
The
parameters are entered via a form...frmStaffFollowUp. It works well,
except I
am trying to make a small change to no avail. When there are No
Records
Found, I would still like the date parameter to show...something
like
"No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far
eveything
that I have stabbed at has returned #Error. Any help is greatly
appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " &
" - "
&
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 
K

Kathy

It worked beautifully!...thank you for your patience and staying with me
through this problem.
--
Kbelo


Ken Snell (MVP) said:
I've tested the IIf expression with the textbox in the report header section
or in the page header section. Both locations work without giving me an
#Error in that textbox.

I do note a syntax error in your IIf expression, now that I study it more
carefully. Try it this way (without the [ ] characters around the reference
to the form's controls):

=IIf(Report.HasData,Forms!frmStaffFollowUp!txtStartDate & " " & " - " & "
" & Forms!frmStaffFollowUp!txtEndDate,"No Records Found for " &
Forms!frmStaffFollowUp!txtStartDate & " " & " - " & "
" & Forms!frmStaffFollowUp!txtEndDate)

--

Ken Snell
<MS ACCESS MVP>



Kathy said:
Hello again...the textbox is in the header section of the report. When I
used
your code there, it worked if there were records or if I removed the
second
reference to the date parameter and just had "No Records Found"...then it
would work too. Just seemed like it glitched on the second date reference
and
thus would not return: No Records found for 1/1/2000 - 1/1/2001 (as
example).
I even tried to build another TestReport to see if there was something in
my
current report that could cause the glitch...but I had the same error.
Logically, your suggestion should work, but just not happening. Again I
appreciate your help. (I can live with this result, if it looks like we
have
reached an impasse, but still willing to try other suggestions.)
--
Kbelo


Ken Snell (MVP) said:
Hmm... strange result. In which section of the report is the textbox
located -- the one that you want to display the info per the solution
that
I'd posted?

--

Ken Snell
<MS ACCESS MVP>


Thank you for your reply...your suggestion looks like it should
completely
solve the problem, but I am still receiving #Error when there are no
records
found. (If there are records, then the date parameter returns
accurately.)
Thus I double-checked everything, but still got the same result when
there
are no records. So I separated into two text boxes. One is a text box
which
displays the parameter dates...no IIF statement involved. Then another
text
box directly underneath displays the following:

IIf(Report.HasData, " ", "No Records Found").

This arrangement is working, but just frustrating as it should work as
you
suggested in your reply. If you have any other thoughts, I would
appreciate
hearing from you.
Thanks again.


--
Kbelo


:

Perhaps this:

=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " & " -
" &
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found for " &
[Forms!frmStaffFollowUp!txtStartDate] & " " & " - " & "
" & [Forms!frmStaffFollowUp!txtEndDate])

--

Ken Snell
<MS ACCESS MVP>




Hello...I am using the code below to show a date parameter on a
report.
The
parameters are entered via a form...frmStaffFollowUp. It works well,
except I
am trying to make a small change to no avail. When there are No
Records
Found, I would still like the date parameter to show...something
like
"No
Records Found for 1/1/2007 - 2/1/2007". I am a novice and so far
eveything
that I have stabbed at has returned #Error. Any help is greatly
appreciated.


=IIf(Report.HasData,[Forms!frmStaffFollowUp!txtStartDate] & " " &
" - "
&
"
" & [Forms!frmStaffFollowUp!txtEndDate],"No Records Found")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top