Solved

What is the value of a blank textbox control?

Posted on 2012-03-27
3
294 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
  • 2
3 Comments
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Its either empty or null.

Try this :

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

Accepted Solution

by:
mbizup earned 500 total points
Comment Utility
For either :

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

Author Closing Comment

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

Sandra
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now