Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

TextBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barcode - 18 Mar 2008 10:27 GMT
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
KARL DEWEY - 18 Mar 2008 21:45 GMT
Help me understand what you are doing as I am not familiar with the syntax
you are using ---     =Sum("[small]";"table1")  >= Sum("[big]";"table2")

Signature

KARL DEWEY
Build a little - Test a little

> Hello
>
[quoted text clipped - 16 lines]
> I appreciate your help,
> thank you
Barcode - 21 Mar 2008 22:03 GMT
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
BruceM - 24 Mar 2008 12:23 GMT
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 here:
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.

> Hello
>
[quoted text clipped - 6 lines]
>
> Thanks a lot
BruceM - 24 Mar 2008 12:46 GMT
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."

> 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
[quoted text clipped - 33 lines]
>>
>> Thanks a lot
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.