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: Max Column Value, Except...



 
 
Thread Tools Display Modes
  #1  
Old November 7th, 2009, 11:58 PM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Textbox: Max Column Value, Except...

I need a textbox to show the highest value of a column within a table, but
exclude the values: 000, 994, 995, 996, 997, 998, and 999

Thanks

--
Message posted via http://www.accessmonster.com

  #2  
Old November 8th, 2009, 01:04 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Textbox: Max Column Value, Except...

On Sat, 07 Nov 2009 23:58:38 GMT, "User via AccessMonster.com" u36225@uwe
wrote:

I need a textbox to show the highest value of a column within a table, but
exclude the values: 000, 994, 995, 996, 997, 998, and 999

Thanks


=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"

assuming that the column is of Text type. Leave off the ' marks if it's Number
(and be aware that 0, 00, 000, and 0000000000000 are all exactly the same
number).
--

John W. Vinson [MVP]
  #3  
Old November 9th, 2009, 03:09 AM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Textbox: Max Column Value, Except...

=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"


I wasn't able to get the code to work correctly. All I get is a "0"

--
Message posted via http://www.accessmonster.com

  #4  
Old November 9th, 2009, 03:23 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Textbox: Max Column Value, Except...

On Mon, 09 Nov 2009 03:09:41 GMT, "User via AccessMonster.com" u36225@uwe
wrote:

=DMax("[columnname]", "[tablename]", "[columnname] NOT IN ('000', '994',
'995', '996', '997', '998', 999')"


I wasn't able to get the code to work correctly. All I get is a "0"


More info please. What's the name of the table? of the column? what's it's
datatype? what's actually in the column? what exact expression did you in fact
use?
--

John W. Vinson [MVP]
  #5  
Old November 9th, 2009, 08:45 PM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Textbox: Max Column Value, Except...

More info please.

What's the name of the table?

"tblEmpList"

The column?

"EmployeeID"

What's it's datatype?

Text

What's actually in the column?

"000, 001,......999"

What exact expression did you in fact use?

=DMax("[EmployeeID]","[tblEmpList]","[EmployeeID]") Not In ('000','994','995',
'996','997','998','999')


Thank you for helping!!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #6  
Old November 9th, 2009, 09:23 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Textbox: Max Column Value, Except...

On Mon, 09 Nov 2009 20:45:53 GMT, "User via AccessMonster.com" u36225@uwe
wrote:

More info please.


What's the name of the table?

"tblEmpList"

The column?

"EmployeeID"

What's it's datatype?

Text

What's actually in the column?

"000, 001,......999"

What exact expression did you in fact use?

=DMax("[EmployeeID]","[tblEmpList]","[EmployeeID]") Not In ('000','994','995',
'996','997','998','999')


Thank you for helping!!


Misplaced premature parenthesis and quotemark:

=DMax("[EmployeeID]", "[tblEmpList]", "[EmployeeID] Not In ('000','994','995',
'996','997','998','999')")

--

John W. Vinson [MVP]
  #7  
Old November 12th, 2009, 03:20 AM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Textbox: Max Column Value, Except...

=DMax("[EmployeeID]", "[tblEmpList]", "[EmployeeID] Not In ('000','994','995', '996','997','998','999')")

Works Perfect!!!

Thank you!!!

--
Message posted via http://www.accessmonster.com

 




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 12:42 PM.


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