A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

TextBox



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2008, 09:27 AM posted to microsoft.public.access.forms
Barcode
external usenet poster
 
Posts: 10
Default TextBox

Hello

May I get some help in programming on MS Access, the following code should
be inside a textbox in a form

=Sum("[small]";"table1") = Sum("[big]";"table2")

Example
"[small]";"table1" = 10
"[big]";"table2" = 10

Code=
If Null = 10 Show 0 of 10
If 10 = null Show 10 of 0
If Null = null Show 0 of 0
if 10 = 10 Then Show with RED color 10 of 10
if 2 = 10 Then Show 2 of 10

I appreciate your help,
thank you
  #2  
Old March 18th, 2008, 08:45 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default TextBox

Help me understand what you are doing as I am not familiar with the syntax
you are using --- =Sum("[small]";"table1") = Sum("[big]";"table2")

--
KARL DEWEY
Build a little - Test a little


"Barcode" wrote:

Hello

May I get some help in programming on MS Access, the following code should
be inside a textbox in a form

=Sum("[small]";"table1") = Sum("[big]";"table2")

Example
"[small]";"table1" = 10
"[big]";"table2" = 10

Code=
If Null = 10 Show 0 of 10
If 10 = null Show 10 of 0
If Null = null Show 0 of 0
if 10 = 10 Then Show with RED color 10 of 10
if 2 = 10 Then Show 2 of 10

I appreciate your help,
thank you

  #3  
Old March 21st, 2008, 09:03 PM posted to microsoft.public.access.forms
Barcode
external usenet poster
 
Posts: 10
Default TextBox

Hello

Thank you for answering me.
In fact there is many questions on my project.

http://w5.nuinternet.com/s650100026/databas1.accdb

But for this question I asked, you can see on my files what I meant.

Thanks a lot

  #4  
Old March 24th, 2008, 11:23 AM posted to microsoft.public.access.forms
BruceM[_2_]
external usenet poster
 
Posts: 1,763
Default TextBox

I'm probably not the only person who is reluctant to open files from an
unknown source. You should be able to explain what you intend to accomplish
with:
=Sum("[small]";"table1") = Sum("[big]";"table2")
You may be able to use DSum to total values from a table that is not in the
record source for your form or report. From VBA Help:
"You may want to use the DSum function when you need to display the sum of a
set of values from a field that is not in the record source for your form or
report."

However, you should know that comparison's to Null will fail. Null is not
zero. More information he
http://allenbrowne.com/casu-11.html

In these examples from your original post, only the fourth one will evaluate
to True. You first three will produce an error, and the fifth one will be
false.
Code=
If Null = 10 Show 0 of 10
If 10 = null Show 10 of 0
If Null = null Show 0 of 0
if 10 = 10 Then Show with RED color 10 of 10
if 2 = 10 Then Show 2 of 10

You can use the Nz function to replace Null with zero, if that is your
intention. Help has more information about Nz.


"Barcode" wrote in message
...
Hello

Thank you for answering me.
In fact there is many questions on my project.

http://w5.nuinternet.com/s650100026/databas1.accdb

But for this question I asked, you can see on my files what I meant.

Thanks a lot


  #5  
Old March 24th, 2008, 11:46 AM posted to microsoft.public.access.forms
BruceM[_2_]
external usenet poster
 
Posts: 1,763
Default TextBox

Just to clarify, I used the possessive where I meant to use a plural. This:
"However, you should know that comparison's to Null will fail."
should be:
"However, you should know that comparisons to Null will fail."

"BruceM" wrote in message
...
I'm probably not the only person who is reluctant to open files from an
unknown source. You should be able to explain what you intend to
accomplish with:
=Sum("[small]";"table1") = Sum("[big]";"table2")
You may be able to use DSum to total values from a table that is not in
the record source for your form or report. From VBA Help:
"You may want to use the DSum function when you need to display the sum of
a set of values from a field that is not in the record source for your
form or report."

However, you should know that comparison's to Null will fail. Null is not
zero. More information he
http://allenbrowne.com/casu-11.html

In these examples from your original post, only the fourth one will
evaluate to True. You first three will produce an error, and the fifth
one will be false.
Code=
If Null = 10 Show 0 of 10
If 10 = null Show 10 of 0
If Null = null Show 0 of 0
if 10 = 10 Then Show with RED color 10 of 10
if 2 = 10 Then Show 2 of 10

You can use the Nz function to replace Null with zero, if that is your
intention. Help has more information about Nz.


"Barcode" wrote in message
...
Hello

Thank you for answering me.
In fact there is many questions on my project.

http://w5.nuinternet.com/s650100026/databas1.accdb

But for this question I asked, you can see on my files what I meant.

Thanks a lot



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.