I'm trying to write the code to get the desired result: - CN060901, CN060902, etc...?
CN060901 stands for:-
06 - Year
09 - Month
01 - Serial number (dn_no from the ".dfbnos" table)
dbfnos is the table of the auto-numbering, starting from 01. dn_no is the field name in the table (.dbfnos).
Thanks
millbear
Just a Beginner! Need help badly.
CN060901 stands for:-
06 - Year
09 - Month
01 - Serial number (dn_no from the ".dfbnos" table)
dbfnos is the table of the auto-numbering, starting from 01. dn_no is the field name in the table (.dbfnos).
Code:
if empty(thisform.pf.pg1.invno.value)
select dbfnos
goto 3 && Remarks: For Credit Note
select dbfbcn
seek TRIM('CN' + right(str(dtoc(df_date),4),2) + right("00"+alltrim(str(month(df_date))),2) + str(dbfnos.dn_no+1))
do while not eof() .and. df_ref=alltrim(str(dbfnos.dn_no+1))
select dbfnos
do while .not. rlock()
enddo
replace dn_no with dn_no + 1
unlock
flush
select dbfbcn
skip
enddo
select dbfnos
do while .not. rlock()
enddo
replace dn_no with dn_no + 1
lnextinvno = right("000000"+alltrim(str(dn_no)),3)
unlock
flush
else
lnextinvno = thisform.pf.pg1.invno.value
endif
Thanks
millbear
Just a Beginner! Need help badly.