![]() |
|
|
#1
|
|||
|
|||
|
I have a daily report which needs to be run and saved even if there is are no records returned from the query. Originally I formatted the header to display the report name plus the user entered paramater in the underlaying query however if the query returns no records it will not pass the paramater to the report. How can I force the query to pass the paramater entered? I know most people don't require a report with no records but in this case even no records is important to archive.
Thank you. |
|
#2
|
|||
|
|||
|
If it is just a report that you are running couldn't you just put the results into a recordset (or maybe a temporary table) and use something like
Me.Yourtextbox.DefaultValue = "No Records Returned." If rs.BOF=rs.EOF then Me.Yourtextbox.Visible = True End If I don't recall the exact sytax, but you should get the idea. I don't think you could do this directly on the query results, thus the recordset or table suggestion. If you used a temporary table you would need to use DFirst and DLast. Obviously, the OnOpen Event should be set to Me.Yourtextbox.Visible = False |
|
#3
|
|||
|
|||
|
Thank you for the reply. Unfortunately that is a bit beyond my skills. To clarify do you mean create a temporary table and base the report on the table? If so how would I force the parameters entered in the query into the temp table so the report would pick it up?
|
|
#4
|
|||
|
|||
|
Okay, even easier...
Why don't you use the DLast function and test for null. If Null then your control would display that there are no records via the control source. If your control was a list box for example it might look like this. Quote:
Quote:
|
|
#5
|
|||
|
|||
|
Thank you. The only problem is not just to show there are no records but to carry through the paramater entered. No records is as important as records returned. For example there was a text box which contained the text and the query parameter to run the report so it would display "Check In for [date entered]" or "Check In 02/09/09"
The problem is when the query returns no records, it does not pass the parameter entered to the report so the title just contains an error. I need to title to contain the paramater the user entered regardless of whether the query returns any records. Is there a way to do this without extensive code? Thanks in advance. |
|
#6
|
|||
|
|||
|
Quote:
Quote:
If you wanted to put this in the code I provided change: Code:
Me!lstDisplayQryResults.RowSource = " No Records to Display" To....Code:
Me!lstDisplayQryResults.RowSource = " No Records to Display for " & Me.YourDateTextBoxName |
|
#7
|
|||
|
|||
|
I am using a simple report based on a select query which prompts the user for the parameter prior to each run. It is the paramater the user inputs that I need to display on the report even when the report contains no matching records. Are you suggesting using a text box to initiate the query rather than allowing the native prompt? Thank you
|
|
| Bookmarks |
| Tags |
| report |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculate difference of $$ than can display in the subtotals in a report | taniuca | Queries | 0 | 08-07-2008 05:02 PM |
| How to display data from another record | rodrigo | Access | 1 | 07-24-2006 05:29 PM |
| How to Display parameter values on the report | fadone | Reports | 4 | 01-04-2006 11:36 PM |
| Add combo box to parameter query | louisa14 | Queries | 1 | 12-10-2005 05:38 AM |
| DISPLAY INPUT PARAMETERS ON THE REPORT | fadone | Forms | 1 | 12-09-2005 07:26 PM |