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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|