Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF date is nulll

Status
Not open for further replies.

cthai

Technical User
Apr 19, 2011
53
US
Hi

not sure if this is possible but can we show a date when the data is null?

I have a [Begin Date] and [End Date] where a user is prompt to enter a range of date that they would like to see the report... however when there is no data for the date it just come back blank... i would like to show the date they enter rather then blank


Date: IIf([DateEnter] Is Null,"Date User enter???",[DateEnter])
 
IMO don't use parameter prompts in queries faq701-6763.

Are you concerned about the user not entering dates or the report record source not returning any records?

Duane
Hook'D on Access
MS Access MVP
 
Can you use the Nz function to supply the text rather than IIf?

Gluais faicilleach le cupan làn
 
Problem 1: user fails to enter a date into parameter query and therefore gets an empty report. Solve by following Dhookham's advice and getting the dates from a form rather than a parameter query. The form can have default dates (i.e. today = date()) filled in already, and/or can check for valid dates before opening the report.
Problem 2: User has entered dates, but some records do not have a date and therefore don't appear: make your sql look for null or < #whateverdate#.
Problem 3: User enters dates that lead to a blank report because no records match, and user doesn't like this. Solution: use the report's "on no data" event to provide an explanatory message and cancel it.
 
thanks for all your help! i was able to figure out what parameter I need to set... some of the date range is NULL so it show up #ERROR# so what i end up doing is have it just give the date the user generate the report... when there is no data match.

thanks again for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top