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 / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Incrementing a field without using autonumber

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Procrustes - 26 Jul 2007 22:22 GMT
I'm new to Access and need to increment a long number field.  I built a test
database called Order test with two fields, Key name and Next seq and have
been trying to increment Next seq by using the Expression builder.  I put in
the following:
=DMax([Next seq],"Order test")+1.

I get no values as a result.  I've also tried various forms of Count without
success.

I'd appreciate any help I could get.
Larry Linson - 26 Jul 2007 23:44 GMT
_Where_ did you put in the

 > =DMax([Next seq],"Order test")+1.

that "didn't work" and, while we are asking for clarification, exactly _how_
did it not work, that is, _what_ were the symptoms of it "not working."

If you put that in the Control Source field, how did you think you were
specifying the field into which it would be stored?  If you put that into
appropriate event code, it should retrieve the largest value of the Next seq
Field of table "Order test", increment it by one, and return the value.
It'd be up to you to make sure that value is stored into the appropriate
Field in the Record.

Larry Linson
Microsoft Access MVP

> I'm new to Access and need to increment a long number field.  I built a
> test
[quoted text clipped - 9 lines]
>
> I'd appreciate any help I could get.
Procrustes - 27 Jul 2007 15:14 GMT
Thank you for responding.

My first attempt was to right click 'Next seq', select Expression Builder
and entering the formula.  It produced nothing, no error, no message.

Based on your response, I right clicked on 'Next seq', selected Properties,
Data, entered the formula in Default value and saved.  On data entry, I got
'#Error' in the Next seq field.

> _Where_ did you put in the
>
[quoted text clipped - 26 lines]
> >
> > I'd appreciate any help I could get.
 
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



©2009 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.