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 / February 2008

Tip: Looking for answers? Try searching our database.

Add Next Number To A Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ange Kappas - 08 Feb 2008 17:31 GMT
Hi,
       This is probably so simple I can't seem to figure it out.

I have a Table(tblACCOUNTNO) which has only one field called ACCOUNT NUMBER
and starts from number 1.

I want to add code to a form button which will add a new record to the
'tblACCOUNTNO' and it will be the next number in other words +1, which in
this case will be number 2.

How simple does that sound.

Thanks
Ange
fredg - 08 Feb 2008 18:26 GMT
> Hi,
>         This is probably so simple I can't seem to figure it out.
[quoted text clipped - 10 lines]
> Thanks
> Ange

Dim strSQL As String

strSQL = "Insert into tblAccoutino([Account Number]) values (" &
DMax("[Account Number]", "tblAccountino") + 1 & ");"

CurrentDb.Execute strSQL, dbFailOnError
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Ange Kappas - 09 Feb 2008 08:19 GMT
Thanks Fred Appreciated
Ange

>> Hi,
>>         This is probably so simple I can't seem to figure it out.
[quoted text clipped - 18 lines]
>
> CurrentDb.Execute strSQL, dbFailOnError
 
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.