Re: Number sequence



It looks like it also uses "incrementdigit" Here is that one as well.

Function IncrementDigit(c As Byte) As Byte

'{increments a digit in a sequence field. Returns true if there is no carry,
false if another
' carry operation on the next most significant digit must be performed.}
' begin
If (Chr(c) <> "9") And (UCase(Chr(c)) <> "Z") Then
IncrementDigit = c + 1
Else
If c = Asc("9") Then IncrementDigit = Asc("0")
If c = Asc("z") Then IncrementDigit = Asc("a")
If c = Asc("Z") Then IncrementDigit = Asc("A")
End If
End Function

Thanks
Mark

"tina" wrote:

well, i see that the function is using another custom function,
"AdvanceSequence()". since i don't see anything that would account for the
result you described (07.0000), i think we'll need to see that function
procedure too. find the function, the same way you found the first one, and
post the code, please.

hth


"Mark G" <MarkG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:49EAB3D6-7744-4531-B6A9-EA910429D52B@xxxxxxxxxxxxxxxx
Thank you for the quick reply, and the instructions. Here is the
information.

Public Function GenNextSequence(TableName, FieldName, Seed)
' gets next sequence value from TableName and FieldName, Seed is the
starting value
Dim rs

On Error Resume Next
Seed = Nz(Seed, "0")
Set rs = CurrentDb.OpenRecordset("Select TOP 1 [" & FieldName & "] as
SeqVal from [" & TableName & "] ORDER BY [" & FieldName & "] DESC")
If Not rs.EOF Then Seed = CStr(IIf(Nz(rs("SeqVal"), "") = "", Seed,
rs("SeqVal")))
GenNextSequence = AdvanceSequence(CStr(Seed))
If Err Then GenNextSequence = "#SeqErr"
rs.Close
Set rs = Nothing

End Function

Thanks
Mark

"tina" wrote:

looks like a custom function: GenNextSequence(). assuming that this is
where the number assignment is actually coming from, we'd need to see
the
function procedure in order to make recommendations.

open your database, and open any module on the Modules tab. from the
menu
bar, click Edit | Find. in the Find dialog, type "Function
GenNextSequence("
only without the double quotes. in the Search section below, choose
Current
Project, then click Find Next.

you should find the function procedure, which starts with the line you
typed
in (Function may be preceded by Public), and ends with "End Function" -
again, sans quotes. copy the entire procedure from beginning to end, and
paste it into a post, so we can see it.

hth


"Mark G" <MarkG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:585481AD-82D6-44E9-85B4-BE8570063882@xxxxxxxxxxxxxxxx
We have a field in one of our forms in our database that automatically
generates a run number for fire calls in sequence. The format that we
use
is
07-999. Everything was working fine until we hit what should have
been
07-1000. Now when it is supposed to assign the next number in the
sequence
it displays 07.0000. Any help would be greatly apreciated. I just
dabble
with access and have no formal training which is more than the rest of
the
department, and since I do I kind of inherited this database we are
using.
This code is in a tab labeled "calculations" on a subform. I think
this
is
what is telling the field what to do.
=GenNextSequence("daylog3","RUN#","05-0001"). I would like it to
transition
from 07-999 to 07-1000 just as it did for the first 999 numbers.

Thanks
Mark






.



Relevant Pages

  • Re: Review of Mueckenheims book.
    ... If infinite, the limits of the ... that the reals are not countable. ... He starts with the sequence of rationals: ... in the building of the diagonal *each* digit has to be changed. ...
    (sci.math)
  • Re: Well Ordering the Reals
    ... >>> rightmost zero in an unending sequence of ever more rightward ... >> naturals, you might as well call it something, I suppose. ... > In TO's system of "whole numbers", there is a most significant digit and ... >> infinite unending string of bits, even if most are generally ignored. ...
    (sci.math)
  • Re: .9 repeating
    ... Represent positive infinitesimals with digits. ... let R' be the set consisting of "digit sequences" ... We map x in [0,1) to the sequence ... Now we make an arbitrary choice: we interpret infinite digit sequences ...
    (sci.math)
  • Re: Number sequence
    ... '{increments a digit in a sequence field. ... GenNextSequence = AdvanceSequence) ... and open any module on the Modules tab. ...
    (microsoft.public.access.forms)
  • Re: Number sequence
    ... Thank You UpRider your'e Awsome. ... '{increments a digit in a sequence field. ... and open any module on the Modules tab. ...
    (microsoft.public.access.forms)

Loading