I have code behind a button on a form that is supposed to create a Vendor Invoice No. each time it is run. The invoice no. is based on the WORKDATE. At the top of my code for my button I have this:
STR:=DELCHR('EXPRT'+FORMAT(WORKDATE)+'-1','=','/');
PH.SETFILTER("Buy-from Vendor No.",EmployeeExpense3."Employee No.");
PH.SETFILTER("Posting Date",FORMAT(WORKDATE));
IF PH.FINDFIRST THEN
STR:=INCSTR(STR);
The DELCHR works fine, but for some reason I can not figure out how to get the number to change each time the button is run. Please help.
Comments
increment alpha variable?
http://www.mibuso.com/forum/viewtopic.php?t=14078
http://www.BiloBeauty.com
http://www.autismspeaks.org
i := -1;
PH.SETFILTER("Buy-from Vendor No.",EmployeeExpense3."Employee No.");
PH.SETFILTER("Posting Date",FORMAT(WORKDATE));
IF PH.FINDFIRST THEN BEGIN
i += 1;
STR:=DELCHR('EXPRT'+FORMAT(WORKDATE)+FORMAT(i),'=','/');
END;
Pargesoft
i := -1;
PH.SETFILTER("Buy-from Vendor No.",EmployeeExpense3."Employee No.");
PH.SETFILTER("Posting Date",FORMAT(WORKDATE));
IF PH.FINDFIRST THEN BEGIN
i += 1;
STR:=DELCHR('EXPRT'+FORMAT(WORKDATE)+FORMAT(i),'=','/');
END;
Pargesoft
Edit:
Ok this is working, however I have to run it twice. The first time it tries to use the previous STR. The second time it uses the next one.