Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What is the value of a blank textbox control?

Posted on 2012-03-27
3
Medium Priority
?
304 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

877 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