Do not use on any
shared computer
August 30, 2008 03:26am pdt
 
[x]
Attachment Details

Renumbering (re-sequencing) Autonumber

Our company policy allows duplicate records to be created. Each duplicate record is expected to increment by 1 and grouped by the entire like operant preceding alphanumeric
for example - 20080409-KW-TA-1140-112-DM.
I am attaching a breakdown of tblMain showing group of LIKEOPERANTS in tblMain_a, tblMain_b, tblMain_c and tblMain_d respectiely. http://www.geocities.com/bombastikbill/AutoSequenseJobNo-v2.zip

In this sample you will find a module that is used by multiple forms in creating JobNos. This module may be modified by experts if needed.

The tblMain table is not related to any other tables and each Job No is created using the following: In tbMain, the following fields already exist in columns which
are utilized to create the JobNo value.

(1). tblMain.DateCreated - e.g 20080410 -- Date
(2). "KW" is added right after the date as Tag name
     as such form part of the "Like Operant" when grouping
     the JobNo IDs.
(3). tblMain.WConnTypeID has these values "WC", "TA", "TP" etc..
     .... each value is inserted as well in Creating the JobNo
     Like Operant
(4). tblMain.BlockNo is the next in line field utilized in that sequence
(5). tblMain.LotNo is the next in line field utilized in that sequence
(6). tblMain.ServiceType is the next in line field utilized in that sequence.

If items #1 through 6 are followed in that sequence, we'll end up with values shown below:
ID.  LikeOperants:             dateCreated  Tag  WConnTypeID  ServiceTypeID  BlockNo  LotNo  Sequence
1.   KW-TA-1747-14-CM    1/2/2004       KW           TA                   CM               1741       14           01
3.   KW-TA-1747-14-CM    6/1/2004       KW           TA                   CM               1741       14           02
4    KW-TA-1747-14-CM    6/2/2004       KW           TA                   CM                1741      14           03
**************************
The same table with the JobNo is shown below:
ID.  LikeOperants:              JobNo (see tblMain_a)
1.   KW-TA-1747-14-CM    20040102-KW-TA-1747-14-CM-01  
3.   KW-TA-1747-14-CM    20040601-KW-TA-1747-14-CM-02
4    KW-TA-1747-14-CM    20040602-KW-TA-1747-14-CM-04

The current code in creating this JobNo (see attached) seems to work fine
from a data entry form.

New Request.
There are times when JobNo(s) might be deleted due to wrong entries or that a JobNo may have been created in error; or a member of a group of Like Operant  changed and as such it becomes necessary to re-number (resequenced) the affected groups. As such, my company wants to the following:

(1). Delete the specific JobNo in a group of Like Operant as such would like to - create a new column in
      the tblMain containing a tag that indicates that  the JobNo has been deleted. Then show the Job on
      the data entry form or possibly "grey out" the record on the form by making it uneditable after it has
      been "deleted".

(2). "re-number" (re-sequence) the JobNo(s) from the tblMain table in the group of "Like Operants" such
       that the last two digits numbered 01, 03, 04, 06  etc preceeding the Like Operant are re-ordered
      (re-numbered)
(3). When a value in a group of like Operant changes where it becomes necessary to re-group the
      changed JobNo to the new group of Like Operant, and then "re-number" (re-sequence) the changed
      JobNo in the affected groups of Like-Operants.

(Also see the attached text file for examples of Like Operants)

I am willing to accept new ideas in order to be able to achieve my desired objective
Attachments:
 
Download and open in Ms. Word or Notepad
 
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Microsoft
Question Asked By: billcute
Solution Provided By: boag2000
Participating Experts: 2
Solution Grade: B
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Assisted Solution by boag2000

Rank: Wizard

Assisted Solution by boag2000:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by billcute
Author Comment by billcute:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by aikimark
Expert Comment by aikimark:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by billcute
Author Comment by billcute:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by billcute
Author Comment by billcute:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by aikimark
Expert Comment by aikimark:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by boag2000

Rank: Wizard

Accepted Solution by boag2000:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by billcute
Author Comment by billcute:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Open Discussion
Open Discussion
 
Comment by aikimark
@BillCute

"I'll still award you for trying"

This makes two questions about JobNo with no clear resolution.  What was the resolution? (for future readers)

=================================
FOR FUTURE QUESTIONS:
I done a lot of "trying" on these two questions with very little adequate response on your part.  If you don't answer our questions, we can't effectively help you with your analysis, design, or implementation -- your problem solution.
 
 
Comment by billcute
Aikiman:
Here you go:

Public Function ReorderJobNos()
On Error GoTo Error_Routine  
Dim rst3 As New ADODB.Recordset
Dim NewDate As String
Dim NewJobNo As String
Set cn = CurrentProject.Connection
        Dim i As Integer        
If strOperantValue = "ALL" Then
    rst3.Open "qry................", cn, adOpenKeyset, adLockOptimistic
    XCount = Nz(DCount("[zOperant]", "qry................"), 0)
Else
    rst3.Open "qry.............", cn, adOpenKeyset, adLockOptimistic
    XCount = Nz(DCount("[zOperant]", "qry..............", "[zOperant] Like'" & (strOperantValue) & "'"), 0)
End If
  With rst3
     If XCount = 0 Then        
          GoTo Exit_Continue
     Else
        .Requery                  
        strPriorOperant = ""                  
        strCurrentOperant = ""                  
        y = 0                                  
       .MoveFirst
        Do While Not .EOF                      
            DoCmd.Hourglass True
            For i = 1 To XCount
               zProgressBar i, XCount
               strPriorOperant = strCurrentOperant
               strCurrentOperant = .Fields("zOperant")
               If strCurrentOperant Like strPriorOperant Then
                  y = y + 1
               Else
                  y = 1
               End If
              NewDate = Format(.Fields("datCreated"), "yyyymmdd")
               UniqueID = CStr(y)
               NewJobNo = CStr(NewDate & "-" & .Fields("zOperant") & "-" & Format(UniqueID, "00"))
              .Fields("JobNo") = NewJobNo  
              .Update
               If i = XCount Then Exit Do
              .MoveNext
            Next i
        Loop
        DoCmd.Hourglass False
        DoEvents
       .Requery
   End If
      rst3.Close
  End With
Exit_Continue:
    Set rst3 = Nothing
    i = 0
    XCount = 0
    strOperantValue = Empty
    strPriorOperant = Empty
    strCurrentOperant = Empty
    y = 0
    strFrmX = Empty
    Exit Function
Error_Routine:
        MsgBox "Error# " & Err.Number & " " & Err.Description
        Resume Exit_Continue
End Function
 
 
20080723-EE-VQP-34 / EE_QW_2_20070628