If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Parameter on Report
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") -- Kbelo |
#2
|
|||
|
|||
Date Parameter on Report
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" wrote in message ... 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") -- Kbelo |
#3
|
|||
|
|||
Date Parameter on Report
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)" wrote: 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" wrote in message ... 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") -- Kbelo |
#4
|
|||
|
|||
Date Parameter on Report
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" wrote in message ... 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)" wrote: 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" wrote in message ... 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") -- Kbelo |
#5
|
|||
|
|||
Date Parameter on Report
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)" wrote: 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" wrote in message ... 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)" wrote: 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" wrote in message ... 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") -- Kbelo |
#6
|
|||
|
|||
Date Parameter on Report
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!txtStar tDate & " " & " - " & " " & Forms!frmStaffFollowUp!txtEndDate,"No Records Found for " & Forms!frmStaffFollowUp!txtStartDate & " " & " - " & " " & Forms!frmStaffFollowUp!txtEndDate) -- Ken Snell MS ACCESS MVP "Kathy" wrote in message ... 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)" wrote: 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" wrote in message ... 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)" wrote: 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" wrote in message ... 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") -- Kbelo |
#7
|
|||
|
|||
Date Parameter on Report
It worked beautifully!...thank you for your patience and staying with me
through this problem. -- Kbelo "Ken Snell (MVP)" wrote: 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!txtStar tDate & " " & " - " & " " & Forms!frmStaffFollowUp!txtEndDate,"No Records Found for " & Forms!frmStaffFollowUp!txtStartDate & " " & " - " & " " & Forms!frmStaffFollowUp!txtEndDate) -- Ken Snell MS ACCESS MVP "Kathy" wrote in message ... 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)" wrote: 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" wrote in message ... 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)" wrote: 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" wrote in message ... 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") -- Kbelo |
#8
|
|||
|
|||
Date Parameter on Report
You're welcome.
-- Ken Snell MS ACCESS MVP "Kathy" wrote in message ... It worked beautifully!...thank you for your patience and staying with me through this problem. -- Kbelo |
Thread Tools | |
Display Modes | |
|
|