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 / January 2006

Tip: Looking for answers? Try searching our database.

Adding new record- update Unique ID

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mjohnson - 24 Jan 2006 22:26 GMT
I have a table and a form in my database.  On my form, I have used the
command button [Add New Record] and it lets me enter my information.  I would
like for my ListSeg Field in my table to update every time a new record is
added.  

The ListSegs are 4 characters 0001, 0002, 0003, etc and are stored as text.  
How do I get it to autogenerate to the next ListSeg when adding a new record.
I don't want for the user to have to type in the List Seg, but for it to
already be there.

Any suggestions would be appreciated
Klatuu - 24 Jan 2006 23:07 GMT
Make this the Default Value of the control on your form where you want the
ListSeg to be incremented.  ListSegTable is a made up name because I don't
know the name of your table, use your own table name here.

=Nz(DMax("[ListSeg]", "ListSegTable"),0) + 1

> I have a table and a form in my database.  On my form, I have used the
> command button [Add New Record] and it lets me enter my information.  I would
[quoted text clipped - 7 lines]
>
> Any suggestions would be appreciated
Mjohnson - 25 Jan 2006 15:12 GMT
Thanks!  That worked great.  The only thing that I still need to do is format
the LIstSeg so there is a "0" in front of the newly generated number.  Is
there a way I can force the 0 to appear?

> Make this the Default Value of the control on your form where you want the
> ListSeg to be incremented.  ListSegTable is a made up name because I don't
[quoted text clipped - 13 lines]
> >
> > Any suggestions would be appreciated
Klatuu - 25 Jan 2006 15:19 GMT
=Format(Nz(DMax("[ListSeg]", "ListSegTable"),0) + 1, "000")

> Thanks!  That worked great.  The only thing that I still need to do is format
> the LIstSeg so there is a "0" in front of the newly generated number.  Is
[quoted text clipped - 17 lines]
> > >
> > > Any suggestions would be appreciated
 
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.