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 1 / February 2006

Tip: Looking for answers? Try searching our database.

I Need A Help With Auto Generating String (Access 2003)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony Esochaghi - 14 Feb 2006 14:45 GMT
I need some constructive input to be able to finish my program.



I have a field called (1) DateRec, another (2) Municipality and another
(3) Type. These three fields invariably will automatically generate a
string of number for another field that is called FileNumber. This
FileNumber is already the Primary Key in the program. The (1) is the
date received, that is the date the application of the client was
received. (2) The Municipality field will be programmatically structured
to produce one or two letter characters that will represent each
Municipality in the FileNumber for every application within the County
where the applicant is from.  Right now in the program, all the 23
Municipalities are listed in a combo box with their full names. And (3)
which is the Type is the state of the application, it will only be
involved in the FileNumber, when it is an "EXEMPT", then, the
nomenclature will be; an 'E'.



Here comes the drill! When the user enters the date received, it will be
a complete date, with day, month and year. The only thing that will go
to the FileNumber will be the year, like 2006. When a Municipality is
chosen by the user, for instance Atlantic City, it will generate a
nomenclature like 'AC', if it is for Brigantine it will be a 'B'. Each
Municipality will have a unique identifier of one or two characters
only. And there are twenty-three Municipalities in all.  Then the
program will run a query that will check for the last FileNumber under
that Municipality the user has chosen and update the middle number with
one number increment. So the FileNumber will be something like AC-2-2006
or B-1-2006, for another entry on this same Municipality it will be
AC-3-2006 or B-2-2006, AC-4-2006 or B-3-2006 etc. Hence, the middle
number will be like a counter that will help the user to know the number
of applications for each municipality within a certain year. Then, when
there is an Exemption in the application, the user will select EXEMPT
from Type, it will emerge the 'E' with the middle number; like
AC-5E-2006. For this to work the program will enforce the user to enter
Date received, and the Municipality and check for Type before he exit,
the program. This is all that is needed.



I definitely, need a help to get this working. The purpose for this is
to debar the user from entering wrong File numbers.



Thanks in anticipation for your help.

Anthony


david epsom dot com dot au - 15 Feb 2006 07:24 GMT
To make it easier for yourself, create fields for each of the parts
of String

Year, n, Code

You can get year from date like this Year(date)

You can get n from the table like this:
1 + Dlookup("n","table","Year = " & year)

I don't know where you will get municpility codes from.

You can combine them like this:

Year & n & Code

(david)

> I need some constructive input to be able to finish my program.
>
[quoted text clipped - 40 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
 
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.