473,656 Members | 2,762 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 955
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...els eif 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
2189
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 the TemplateColumn below does sender.parent.parent.Cells(9) reference??? IOW, what tag does it reference? The templatecolumn is the 9th field in the datagrid yet no matter what I do, whatever "sender.parent.parent.Cells(9)" is referencing, I do...
3
1976
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 cell normally. In other browsers you can use the css statement empty-cells:show. But this doesn't work in IE. Thanks,
6
1489
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/> If it's blank how can I prevent this element from getting into the XML completely . It is optional according to the schema but fails on validation when it's in there in this form. Jamie
1
9758
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 the common "cells(x,y)" reference, where x and y are integer variables. Also, how do I verify that the cells are empty, since, according to the documentation, the "IsEmpty" function does not work in .NET now? Thanks for any help! ...
2
4662
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() { //Range xlsRng = _sheet.get_Range("G1",Type.Missing).EntireColumn; //MessageBox.Show(xlsRng.EntireColumn.Count.ToString()); Range xlsRng = _sheet.UsedRange;
4
15054
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 browsing to "web services in this solution". Sometimes, I cannot connect connect to my webservice, so I try an "update web reference" - but this results in an error:
0
1306
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 MSSQL database with no problem, it runs fine. But when I tried to add the other Access database, LenderContacts, as another table, it doesn't work. When I first import LenderContacts using Enterprise Manager it turns all of the "text" fields into...
2
3157
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')) { die("Your PHP installation does not have MSSQL support."); } echo "Connecting..."; echo "<BR>";
4
2249
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. The base query, qryPrintCostAssets, returns all data from tblAssets based on a selection in a form. qryPrintCostAssets.ID is key to the rest of the queries pulling their data. SELECT * FROM tblAssets WHERE...
0
8382
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8717
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1600
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.