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 / September 2007

Tip: Looking for answers? Try searching our database.

Custom counter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
XP - 28 Sep 2007 18:00 GMT
I am using Office 2003 (sp3) on Windows XP;

I would like to create an ID that prefixes some text at the beginning of the
value, so for example the unique ID might look like:  bk1; bk2; etc.

I came up with using an autonumber field along side a second column that
prepends the text needed so in the table it looks like:

1   bk1
2   bk2
3   bk3
etc...

Then I saw MS article Q210194 that would essentially do the same thing, but
perhaps a little cleaner?  

Which of these two methods is preferable? Has anyone got any other ideas on
how to do this? Is there a best practice for doing this in MS-Access?

I'm fairly up to speed, but would appreciate any examples in code or
otherwise.

Thanks much in advance for any suggestions or guidance.
Jeff Boyce - 29 Sep 2007 00:59 GMT
Do you need the actual data in the field (be aware that storing two "pieces"
of data in one field is not good db design)?

Would it be enough to have the display of the field include a "constant" =
"bk" (or might there be other prefixes)?

What about using two fields to hold the prefix and the sequence number, and
using a query to "join" them for display in forms and reports? (This is the
preferred/recommended method.)

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I am using Office 2003 (sp3) on Windows XP;
>
[quoted text clipped - 22 lines]
>
> Thanks much in advance for any suggestions or guidance.
 
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.