Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

What is the value of a blank textbox control?

Posted on 2012-03-27
3
Medium Priority
?
302 Views
Last Modified: 2012-06-27
I have a formw ith two subforms.  On the main form, to be used in calculations, is a text box that uses the sum from the variable subform and another textbox that uses the sum from teh constant subform.  HOwever, not both subforms will have totals.  So, how the (&^*^*(&() do I tell the code to check both and if they are not null (or empty) then do something else?  I have tried testing for nulls, 0, etc, and nothing seems to work.  

If Me.txtVar <> "" And Me.txtCon <> "" Then   Also tried
If (Me.txtVar) > 0 And (Me.txtCon) > 0 Then    Also tried
If Not IsNull(Me.txtVar and Not isNull Me.txtCOn

But when the code runs, I get an error or it runs that if statement, but I want to check to see if either one of the fields is empty.  This is on an ACCESS 2003 form/subforms

Sandra
0
Comment
Question by:ssmith94015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 37773836
Its either empty or null.

Try this :

If me.txtbox & "" <> "" THEN
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 37773847
For either :

If me.txt1 & "" = "" or me.txt2 & "" ="" then....
0
 

Author Closing Comment

by:ssmith94015
ID: 37773855
Thank you, I was thinking I would have to scrap an entire day's worth of work over this things!

Sandra
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question