473,412 Members | 4,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Set a default value for a text box in a report

beacon
579 512MB
Is this possible? If not, is there a way I can use IsNull or something like to return zero if there aren't any instances of what my query is returning?

Here's what I have in the text box in the details section of my report:
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("CountOfSkillLevel","qrySkillsWF","SkillLevel = 'Beginner' AND Program = '" & [Program] & "'")
  2.  
If there haven't been any users entered with the skill level of beginner I'm looking to have the report output zero instead of nothing.

I'm not great at expressions in Access 2003, or expressions for that matter, because all of my reference books don't spend any time on them at all.

I tried an IsNull statement, but it changed all of my values in the report to zero even if they weren't supposed to be Null. I know that this is because I didn't set it up correctly, but for learning purposes I will post my faulty expression. Here it goes:
Expand|Select|Wrap|Line Numbers
  1. =IsNull(DLookUp("CountOfSkillLevel","qrySkillsWF","SkillLevel = 'Beginner' AND Program = '" & [Program] & "'")=0)
  2.  
I'm sure I have to use an IIf statement or something, but I can't find anything that will assist me in writing it. Again, I'm not so good with expression.

Thanks everybody...
Nov 16 '07 #1
4 4454
nico5038
3,080 Expert 2GB
Hmm, I don't see the lookup value as a proper parameter in your last line of code.
I would have used:
Expand|Select|Wrap|Line Numbers
  1. =NZ(DLookUp("CountOfSkillLevel","qrySkillsWF","SkillLevel = 'Beginner' AND Program = '" & [Program] & "'"),0)
  2.  
Nic;o)
Nov 17 '07 #2
beacon
579 512MB
I ended up changing one of my tables to more closely reflect the output I desired and created a query from that. Then, when I used the DLookup, my numbers were correct.

Thank you for your help Nico...
Nov 20 '07 #3
nico5038
3,080 Expert 2GB
Well done beacon :-)

Success with your application !

Nic;o)
Nov 20 '07 #4
beacon
579 512MB
Hmm, I don't see the lookup value as a proper parameter in your last line of code.
I would have used:
Expand|Select|Wrap|Line Numbers
  1. =NZ(DLookUp("CountOfSkillLevel","qrySkillsWF","SkillLevel = 'Beginner' AND Program = '" & [Program] & "'"),0)
  2.  
Nic;o)
I'm just curious because I ended up using the NZ part of your equation, but what does the NZ stand for??

Edit *******************************************

Nevermind, I found the Nz method in the MSDN. It's interesting.....makes me wish I would have stumbled upon it long ago.

Thanks again Nico and everyone else for that matter.
Dec 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Charles Kline | last post by:
Hi all, I pretty much set a fields default value to NULL if it not a "required" field in my app. Just wondering if this is the way to go since I just sort of guessed at this method ;) -...
4
by: dekern | last post by:
I have been trying to set the default text value of a TextArea element for about a day now without any luck. Similar to the code used to set the Text field below I would like to use the returned...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
2
by: TadPole | last post by:
Hi all, My main problems are::::::::: 1. Set a value within a block container that can be used and changed by subsequent templates/block-containers/tables etc.. 2. get/determine/find the...
1
by: Patonar | last post by:
Hi, I have a report that is calculating subtotals - however sometimes there is no data to show.... so the subtotal field will be blank. Is there anyway that if this happens i can set the default...
2
by: mudman04 | last post by:
Hi, I searched online for some similar issues that I am facing but was not able come up with anything. I am fairly new with Access (2 months experience) and I am trying to remove a message...
7
by: turtle | last post by:
I want to find out the max value of a field on a report if the field is not hidden. I have formatting on the report and if the field doesn't meet a certain criteria then it is hidden. I want to...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
3
by: brianflannery | last post by:
Greetings all! My problem is this. I've installed a new printer on my computer. This is the "default printer" for access. Now, some of my reports, which were working fine with the old printer,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.