473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

If reference cells are blank, how to make the results go blank

43 New Member
I have to entry boxes on a form. If the boxes are populated then this is the path that is ran:

Expand|Select|Wrap|Line Numbers
  1. If Me.PullForce.Value > 14 And Me.Nuggets.Value > 4 Then Me.Test_Results.Value = "Failed"
  2. If Me.PullForce.Value < 15 And Me.Nuggets.Value < 5 Then Me.Test_Results.Value = "Passed"
  3. If Me.PullForce.Value = "" And Me.Nuggets.Value = "" Then Me.Test_Results.Value = ""
No how do I write it if boxes PUllforce and Nugget are blank so that the Test Results field will go blank?

Thanks
Mar 13 '13 #1
3 949
Seth Schrock
2,965 Recognized Expert Specialist
Since you haven't used code tags, I'm not sure if you have three separate lines or six separate lines. If three, then what you have should work. If six, then you End If after each If statement.

Have you tested this? At first glance, nothings looks wrong, although if Me.PullForce and Me.Nuggets are number fields, then you should be testing for IsNull() instead of empty strings (which is what "" is). Where do you have this code? Do you get any error messages when it runs, or do you just not get the results that you expect?

Also, please read Before Posting (VBA or SQL) Code before posting any more code. It is really important to follow these rules as it helps us read your code and see problems.
Mar 13 '13 #2
tmdrake
43 New Member
I was able to get it to work. Thanks
Mar 13 '13 #3
zmbd
5,501 Recognized Expert Moderator Expert
You really should also consider using the select...case or the if...then...elseif constructs as they are a much cleaner code and ensure that only result of the condition you are testing occurs as expected.
Mar 13 '13 #4

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

Similar topics

2
2177
by: Roy | last post by:
Ok, this is incredibly annoying. Below I have an ImageButton and it's ImageButton_Click sub. See the 6 response.writes? The output for them is displayed below in asterisks. Question: What part of...
3
1962
by: tshad | last post by:
How do I get blank cells to show in my dataGrid? I am databinding to my datagrid, but any cells that are blank, don't show. Normally, you would put an &nbsp in the cell to make IE display the...
6
1480
by: jamie | last post by:
I'm serializing a class and some of the elements end up with blank results. This is fine. When I serialize the class the elements show up in the resulting XML as something like <SigningLicence/>...
1
9753
by: mgoold2002 | last post by:
I'm moving some code from Excel vbs into a .NET context and I'm very new to .NET. I'm trying to make this Excel vb code work in .NET. My questions are: how do I reference cells correctly using...
2
4659
by: shantanu | last post by:
Dear All My requirement is to count the number of cells which are blank in a excel column, for that i am writing the following code;;;;;;;;;;;;;;;;; private void ValidateReviewComment() {...
4
15038
by: Peter K | last post by:
Hi I have a webservice project in Visual Studio, and another project which uses the webservice. My other project has a web reference to the webservice project, created via Visual Studio by...
0
1295
by: LizRickaby | last post by:
My client has several Access databased that they wanted converted into MSSQL to be able to access them online (excuse the pun). I added the first Access database, LenderPrograms, as a table in the...
2
3147
by: mirali00 | last post by:
Hello, This is a strange one! I'm getting blank results for mssql_connect. I created a simple testmssql.php page with the following code: <?php if (function_exists('mssql_connect')) {...
4
2244
by: mbedford | last post by:
How can I make a query return zero values when there are no results? The first level of queries returns data from tables based on a selection made in a form and reported in a different query. ...
0
7076
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
7274
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
7323
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
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
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,...
1
5005
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.