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
|
|||
|
|||
Populate report header field from query parameter
Hello,
I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#2
|
|||
|
|||
You can't get the parameter to display if there are no records. This is a
good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#3
|
|||
|
|||
Thanks Duane. I will do that but I do have another question on this issue. Is
it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#4
|
|||
|
|||
You won't need to. You can just access the control value.
However, if you want to access a parameter prompt value from a query, the query must return at least one record. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Thanks Duane. I will do that but I do have another question on this issue. Is it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#5
|
|||
|
|||
I had the same problem. The parameter did not print because there was no
data. Then I hid a field that should say either "initial", "pending" or "closed" depending what the user put in the parameter box. Then I referenced to the box by creating a new text box, but it was still blank, because the initial field that reads, for example, "initial", did not say that, because there was no data. Did I miss Duane's answer? The website does not seem to give answers. What to do? "Duane Hookom" wrote: You won't need to. You can just access the control value. However, if you want to access a parameter prompt value from a query, the query must return at least one record. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Thanks Duane. I will do that but I do have another question on this issue. Is it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#6
|
|||
|
|||
You can reference the parameter value if the query returns records.
-- Duane Hookom MS Access MVP "Soto" wrote in message ... I had the same problem. The parameter did not print because there was no data. Then I hid a field that should say either "initial", "pending" or "closed" depending what the user put in the parameter box. Then I referenced to the box by creating a new text box, but it was still blank, because the initial field that reads, for example, "initial", did not say that, because there was no data. Did I miss Duane's answer? The website does not seem to give answers. What to do? "Duane Hookom" wrote: You won't need to. You can just access the control value. However, if you want to access a parameter prompt value from a query, the query must return at least one record. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Thanks Duane. I will do that but I do have another question on this issue. Is it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#7
|
|||
|
|||
Is there absolutely no workaround to display the parameter on the report if
there is no data? No programming? "Duane Hookom" wrote: You can reference the parameter value if the query returns records. -- Duane Hookom MS Access MVP "Soto" wrote in message ... I had the same problem. The parameter did not print because there was no data. Then I hid a field that should say either "initial", "pending" or "closed" depending what the user put in the parameter box. Then I referenced to the box by creating a new text box, but it was still blank, because the initial field that reads, for example, "initial", did not say that, because there was no data. Did I miss Duane's answer? The website does not seem to give answers. What to do? "Duane Hookom" wrote: You won't need to. You can just access the control value. However, if you want to access a parameter prompt value from a query, the query must return at least one record. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Thanks Duane. I will do that but I do have another question on this issue. Is it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
#8
|
|||
|
|||
Can you see the earlier postings in this thread that suggest getting all
criteria from controls on forms? You can always reference the form control in your report. -- Duane Hookom MS Access MVP "Soto" wrote in message ... Is there absolutely no workaround to display the parameter on the report if there is no data? No programming? "Duane Hookom" wrote: You can reference the parameter value if the query returns records. -- Duane Hookom MS Access MVP "Soto" wrote in message ... I had the same problem. The parameter did not print because there was no data. Then I hid a field that should say either "initial", "pending" or "closed" depending what the user put in the parameter box. Then I referenced to the box by creating a new text box, but it was still blank, because the initial field that reads, for example, "initial", did not say that, because there was no data. Did I miss Duane's answer? The website does not seem to give answers. What to do? "Duane Hookom" wrote: You won't need to. You can just access the control value. However, if you want to access a parameter prompt value from a query, the query must return at least one record. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Thanks Duane. I will do that but I do have another question on this issue. Is it possible to access the parameter value property of a query from within a report which is bound to that query? "Duane Hookom" wrote: You can't get the parameter to display if there are no records. This is a good reason to use a reference to a control on a form rather than a prompt. Consider reviewing this page http://www.fontstuff.com/access/acctut08.htm on using controls. -- Duane Hookom MS Access MVP -- "jh" wrote in message ... Hello, I have a report that populates a field in the header from a report parameter. This parameter field is a date which is used in the query to pick up all records with a date prior to the entered parameter date. I am making the controlsource property in the report field equal to the query parameter name. If there are records that meet the query criteria the report field properly displays the parameter date entered by the user. The problem is when the query doesn't return any records then the report field doesn't display the value entered by the user as a parameter date but rather displays #Error. Thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
query a number stored as text | Lee | Running & Setting Up Queries | 19 | October 13th, 2004 04:10 AM |
Personal input field in a report from a query. | Louise | Setting Up & Running Reports | 2 | October 7th, 2004 10:10 PM |
Newbie? Do I use Report or Query | John Egan | New Users | 11 | June 28th, 2004 08:31 PM |