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!

Default value

Status
Not open for further replies.

vicktown

Technical User
Jul 13, 2004
27
0
0
CA
GOod day,

I am working with an old database that is very large. I am creating a report that much deal with many blank fields for some records. Is there a way to set a default value on a report for fields that are empty?
 
You may consider the Format event procedure.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
IS there a way i can use an if statement as a Control Source on the Data Tab in the properties box for that field. And if so what would it look like?.
 
What is teh format event procedure?
 
OK i know what OnFormat is now.

Should I use an event procedure in the OnFormat of that text box's footer?

And if so what should the code look like if I dont actually want to change teh information in the tables?

What im looking to do is to see if a field has data, if it does then i want it to print, if it doesnt, then i want the text "NO DATA" to appear.

Thanks.
 
What you want to use is an IIF for the control souce for the text fields on the report. It should read something like the following:

This is taken from the Access Help
IIf(expr, truepart, falsepart)

So yours should say:
IIF(Field, "Field", "NO DATA")

You might not need the quotes, I forget.
 
Thanks
I am using the exact method as one of the examples from the help menu but am getting an error message. "Syntax error (comma)"

I have looked over my command and can find no problems.

Do i need to do soemthing else or am i just missig something. here is my line of code:

IIF(IsNull([tblAssessPar.Assess]),"Not Done",[tblAssessPar.Assess])

 
"Syntax error (comma)"
Some localisations of access want semi-colon (;) instead of comma (,) as arguments separator.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thansk for the tip, unfortunately it didnt do the job

The exact error message is this:

Syntax error in query expression 'First([IIF(IsNull([tblAssessPar.Assess]);"";[tblAssessPar.Assess])'.

, for this line of code in the source data properties box:

IIF(IsNull([tblAssessPar.Assess]);"";[tblAssessPar.Assess])

Do i need to alter the query used by this report?
Using commas also gives a similar error message.
Keep the ideas coming
 
Have you tried the Nz function ?
Nz(tblAssessPar.Assess)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Change this...
IIF(IsNull([tblAssessPar.Assess]);"";[tblAssessPar.Assess])

to this
IIF(IsNull([tblAssessPar].[Assess]),"",[tblAssessPar].[Assess])


Randy
 
Ok dont worry about it, i worked around this problem.
thanks anyway people
 
vicktown, thanks for sharing.
i worked around this problem
Can you please explain the members how you solved your issue ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top