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 / Modules / DAO / VBA / July 2005

Tip: Looking for answers? Try searching our database.

Generating record ID numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paulu - 06 Jul 2005 16:17 GMT
I have an orders form based on a query of two tables.  The form is similar to
the Northwind orders form.  I want to generate an orderID number by counting
the record in one of the underlying tables and incrementing it by one.  The
number msut appear in the control on the form and be saved as the orderID
(recordID) in the underlying table.
Thanks in advance for any help
Bas Cost Budde - 06 Jul 2005 17:52 GMT
in the beforeInsert event:

yourcontrolname = 1 + nz(dmax("orderID","yourTableYouDidntName"),0)

I suggest you make the control both locked and disabled. That is, I
assume the user shouldn't change this number.

> I have an orders form based on a query of two tables.  The form is similar to
> the Northwind orders form.  I want to generate an orderID number by counting
> the record in one of the underlying tables and incrementing it by one.  The
> number msut appear in the control on the form and be saved as the orderID
> (recordID) in the underlying table.
> Thanks in advance for any help

Signature

Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

 
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.