PC Review


Reply
Thread Tools Rate Thread

DMax on Text Field

 
 
Question Boy
Guest
Posts: n/a
 
      5th Nov 2008
I have a little problem that hopefully someone can help me with.

I have a table that currently I cannot make changes to. I will at my next
maintenance window, but I need a temporary solution for now. I have a text
field that actually houses whole numbers (should be sequential 1,2,3,4,.. for
each project in the db as req'd). Anyways, I need to find out the last
number enter to determine the next number that should be used. I used DMax
which works as long as there a 9 or less entries. Above 9, ie 10, it always
return 9 as the Max value and ignore the fact that 10 exists. Is there a way
to tell the DMax Function to interpret the text field as a numerical field?
Below is my code

DMax("[ChangeNum]", "tbl_Changes", "[Projects]='" & Left(Me.Proj,
Len(Me.Proj) - 1) & "'")

Thank you,

QB
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      5th Nov 2008
DMax("CLng([ChangeNum])", "tbl_Changes", "[Projects]='" & Left(Me.Proj,
Len(Me.Proj) - 1) & "'")



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Question Boy" <(E-Mail Removed)> wrote in message
news:631788B0-C4F9-4EC6-8155-(E-Mail Removed)...
>I have a little problem that hopefully someone can help me with.
>
> I have a table that currently I cannot make changes to. I will at my next
> maintenance window, but I need a temporary solution for now. I have a
> text
> field that actually houses whole numbers (should be sequential 1,2,3,4,..
> for
> each project in the db as req'd). Anyways, I need to find out the last
> number enter to determine the next number that should be used. I used
> DMax
> which works as long as there a 9 or less entries. Above 9, ie 10, it
> always
> return 9 as the Max value and ignore the fact that 10 exists. Is there a
> way
> to tell the DMax Function to interpret the text field as a numerical
> field?
> Below is my code
>
> DMax("[ChangeNum]", "tbl_Changes", "[Projects]='" & Left(Me.Proj,
> Len(Me.Proj) - 1) & "'")
>
> Thank you,
>
> QB



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DMax date where other field is not null Jim L. Microsoft Access 4 8th Aug 2009 05:00 AM
using dmax and date field =?Utf-8?B?Q2hyaXM=?= Microsoft Access Queries 2 12th Jun 2007 06:53 PM
DMax for dates in rpt group header returns DMax for entire records =?Utf-8?B?aGVsaW9z?= Microsoft Access Getting Started 1 19th Jul 2005 09:32 PM
Form Field use in a DMAX Statement =?Utf-8?B?UmFuZHlJbk1hc3M=?= Microsoft Access Queries 1 4th Apr 2005 12:28 AM
DMAX() - Text Field Issue Joe Williams Microsoft Access Form Coding 2 31st Mar 2005 06:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:47 PM.