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 Programming / June 2007

Tip: Looking for answers? Try searching our database.

find highest value in field, add 1 and then display in form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Krazy Darcy - 29 Jun 2007 07:56 GMT
In query "filter-for-highest-archive-used" is a field called "volume number"

What I want to do is find the highest number in that field,
Then add 1 to it (as a calculation - not altering the underlying recoed) and
then display the sum on a form to inform the user what the next avaliable
(unused) volume number is.  It will display this in a pop-up form window.

The above mentioned query shows only digital works that have been archived
and it is the data in the query i am working with here.

Thanks for your help
missinglinq - 29 Jun 2007 11:24 GMT
Rather than a query, why not simply use the DMax function? This works whether
VolumeNumber is text or numerical datatype:

NextVolumeNumber = DMax("val([VolumeNumber])", "YourTable") + 1

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Krazy Darcy - 29 Jun 2007 22:26 GMT
Thanks very nuch.

I put the line you provided (changing the names to suit)
into the code for the "onOpen" event for the form.
I checked it against the table to confirm it gave the right value.

This form will be a pop-up form to inform the user what the currently
highest and next number is avaliable. This is so they can key it in manually.
The reason for keying it in manually is that when Digital projects are
entered in, they are archived to dvdr. Depending on the size of the project
folder, more than one project may be archived on the same disk.
Also the volume number field is also used for drawings to indicate what
folder they are in (The media field tells if it is dvd or physical folder).

Thanks very much.

> Rather than a query, why not simply use the DMax function? This works whether
> VolumeNumber is text or numerical datatype:
>
> NextVolumeNumber = DMax("val([VolumeNumber])", "YourTable") + 1
missinglinq - 30 Jun 2007 03:53 GMT
Glad it met you needs, Darcy!

Have a great weekend!

Linq

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

 
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.