Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto increment the last digit in the returned value

Status
Not open for further replies.

frogjumps

IS-IT--Management
Aug 10, 2001
14
US
I need to auto increment the last digit in the returned value of the following: (iLastRMA)
how do I do this, I also need to be able to reset this value daily. Is this even possible?

'** <begin code snip>

'** get iLastRMA from the database

sRMAnum = rsRMAEntry.Fields.Item(&quot;RMAnum&quot;).Value

'** remove all characters to the end of the initials: this is so we
'** can use the returned value to &quot;auto increment&quot; to the next RMA #

iLastRMA = Left(sRMAnum, 9)

'*** the finished RMA # in string format

sRMAstring = sTDate & Left(sRuser,1) & Right(sRuser,1) & CStr(CInt(iLastRMA + 1))

'** <end code snip>

FrOg 8) FrOg 8)
 
ok to auto increment the number, depending on what amount you can simple create a code like

sRMAstring = sRMAstring + 1'(place the number you want to increment it by here)

to reset the sRMAstring just recall the result from the database

Hope that is what you wanted
 
how do I &quot;recall&quot; the results from the database and reset it automatically every new day? FrOg 8)
 
ok

create a script that will determine if the visitor is the first visitor of the day, and if so then the first result is chosen.....

save any information into a second database.. which can be called at any time after the first visitor

also on the first visitor of the day, use something like

connect to database
con.execute(&quot;DELETE * FROM table2)
close database

this will then delete all records from the second table. leaving the first table in tact, so that the record can be called
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top