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.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > show name on report even when data is NULL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-11, 08:19
cthai cthai is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
show name on report even when data is NULL

Hello -

I have this report in Access 2007 with a drop down box that you can select a name of an Employee and then enter a date range [Begin date] and [End date] if the employee selected did not have any case Routed to the report comes back with an #ERROR for the date range and the Assign to field is empty…
Is there a way I can have access show me the date range the person enter and the name they selected? Since we print these report and email them – it looks a bit odd that we have to hand write in where the #ERROR is with the date and then will in the Assign to with the name we selected.
Appreciate any suggestion and help thank you!

Below is the VB code that call the drop down box... not sure if this is any help in understand the process but i figure i add it in ...

Code:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
   Dim stDocName As String
   stDocName = "CloseItemsBlue_rpt"
DoCmd.OpenReport stDocName, acPreview, , "RouteTo = '" & Me.Combo10.Column(1) & "'"
         
Exit_Command8_Click:
   Exit Sub
Err_Command8_Click:
   MsgBox Err.Description
   Resume Exit_Command8_Click
End Sub
Reply With Quote
  #2 (permalink)  
Old 11-02-11, 15:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
This kinda depends on why you are getting the #Error in the date range.

Is it because you are using the values returned from the query (which do not exist) or something else?

You should be displaying the parameters that were supplied to the report for the data range.

This article should help you with how this is done.

ACC2000: How to Reference Parameters in Reports
Reply With Quote
  #3 (permalink)  
Old 11-07-11, 10:26
cthai cthai is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
hi rokslide

thanks for the repond - i read the link you provided and created the parameters but the date function is still showing up #ERROR...I have a field called StatusDate and that is where i have the Begin Date and End Date it's part of the query, when the user enter the StatusDate if there is NO data for that date, it return back blank with and #ERROR for the date field.

Is there away I can have it show the date the user enter rather then #ERROR?
Reply With Quote
  #4 (permalink)  
Old 11-07-11, 14:34
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Is the "date function" using the date from the results or the data from the parameters???

If it is using the date from the parameters then it sounds like you are calling the function incorrectly.

If it is using the date from the results then you need to change it to use the date from the parameters.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On