Text & Number increment.

L

ldiaz

I have a table that it need to have a consecutive number like this:

BRL-00001 and the next capture need to be BRL-00002 and so,,can anyone help
with this??

I have thought to do a Extra table and capture many consecutives numbers,
and put a check box that when I used one consecutive the ckeckBox change to
=true, and the next capture will pick up the next consecutive number if
checkbox is = False.

please help me..
thanks..
 
R

Rick B

This is answered almost every day. Have you tried searching and reading
previous posts?
 
C

Chriske911

I have a table that it need to have a consecutive number like this:
BRL-00001 and the next capture need to be BRL-00002 and so,,can anyone help
with this??

I have thought to do a Extra table and capture many consecutives numbers,
and put a check box that when I used one consecutive the ckeckBox change to
=true, and the next capture will pick up the next consecutive number if
checkbox is = False.

please help me..
thanks..

you just need to hold 1 number, this being the last you used
then you use the code below
I leave it up to your creativity to implement it :')
remember, this is just out of my head so look out for errors

sub control-add-new-record_click()
dim rs as dao.recordset
dim NewRecordNumber as string

NewRecordNumber = RetrieveParameter("ownID")

set rs = me.recordset.clone
rs.addnew
rs.fields("MY-ID").value = NewRecordNumber
rs.update
me.requery
rs.movelast
rs.close

end sub

function RetrieveParameter(ParameterType as string) as string
dim rs as dao.recordset
dim Holdparameter as string

set rs = currentdb.openrecordset("tableallparameters",dbopendynaset)
rs.findfirst "type = '" & parametertype & "'"
HoldParameter = rs.fields("parametervalue") + 1

rs.edit
rs.fields("parametervalue")= HoldParameter
rs.update
rs.close
set rs = nothing

RetrieveParameter = "BRL-" & right(00000 & HoldParameter,5)

end function

good luck
 
L

ldiaz

Hi Rick, I have searched in many post and didn't find something that can
helping me.

please add an attachment for me please ,,,many thanks...
 
L

ldiaz

Thank you my friends..

this community is very important as member,

Best regards from Baja California
 
L

ldiaz

Hi Chriske911, could you send me an example, because I tried many times but
does not working , appear a error message ,,, will appreciate so much if you
send it to me,,,


anyway thanks for your help..

this is my-email.
[email protected]
 
C

Chriske911

Hi Chriske911, could you send me an example, because I tried many times but
does not working , appear a error message ,,, will appreciate so much if you
send it to me,,,

anyway thanks for your help..

this is my-email.
[email protected]

some creativity and insight is needed off course ^^
what and how did you make use of this code?
what are the errors you're getting?

grtz
 
Top