want to give in where I can find the stamp in my books).and in each
book I can put 50 stamps (with documentations about the composer and
his works, where he was born, died, ....). So I have created two fields
who can count in the tabel stamps wehere I made a field composers that
I linked with the tabel composers, ...
The field ZegelsInBoek is a text with notation: ="06/" &
format(tussen,"0000") & "/" & format(einde,"00") with
inputmask 00/0000/01
06 refers to stamps about composers and do NEVER change
0001 refers to the book (see under)
01 refers to the first stamp in the book
This last field has an influence in himself (field ZegelsInBoek) and
the second field (boek).See under.
When the stamp 06/0001/50 is done. It has to change in 06/0002/01. And
so one.
The field boek is a text with notation: =laatste boek and imputmask
2006/00
2006 refers to the year
01 is the first book I made during the year 2006) than count + 1, so
2006/02 ... 2006/ in one year
The counting + 1 depends of the result of the file ZegelsInBook
When we have a new year the new value has to be 2007 and the counting
start again with 01...2007/02
I want to try with the
Dim rs as recordset
Dim tussen, laatste,einde
Set rs=dbengine(0)(0).openrecordset("Select max(zegels) as
grootste,max(boek) as grootsteboek from table")
Laatste=rs!grootste
Laatsteboek=rs!grootsteboek
If val(mid(laatste,9))=30 then
Tussen=val(mid(laatste,6,4))+1
Einde=1
Laatsteboek=left(laatsteboek,7) &
format(val(mid(laatsteboek,8)+1))
Else
Tussen=val(mid(laatste,6,4))
Einde= val(mid(laatste,9))+1
Endif
I want to place this code after input of a stamp ad I hope dat the
numberfield will start automaticully
Michael Cole - 27 Dec 2006 04:30 GMT
> The field boek is a text with notation: =laatste boek and imputmask
> 2006/00
[quoted text clipped - 4 lines]
> When we have a new year the new value has to be 2007 and the counting
> start again with 01...2007/02
I would strongly suggest that you do this in the database via a trigger of
some sort, not with code from the application. What happens if the user
enters data directly into the database, not via your application?
Post back with what database you are using.
(Oh, and its not really an API question - I'm not sure why you posted it
here. Perhaps it might also be of benefit to you to have posted it to a
more likely newsgroup?)

Signature
Regards,
Michael Cole