Solved

What is the value of a blank textbox control?

Posted on 2012-03-27
3
298 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
ID: 37773836
Its either empty or null.

Try this :

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

Accepted Solution

by:
mbizup earned 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

726 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