TheLazyPig
Programmer
Hi!
I'm creating an extract form where the process of the code is from a deped.prg.
Here is my extract button code below...
After I run this program I get an error of...
But deped.prg location is correct.
If I run deped.prg alone without the form, a pop up of details of the extract then I need to close it for the process to execute again then
But I only need the crormain that's why I USE it in my code
Is this the reason why I get the error or is it another?
Thanks for the replies!
I'm creating an extract form where the process of the code is from a deped.prg.
Here is my extract button code below...
Code:
SET CENTURY OFF
SET CENTURY ON
SET DELETED ON
SET SAFETY OFF
SET UDFPARMS TO REFERENCE
CLOSE ALL
CLEAR
LOCAL lcDir,bkDir,pgDir,lcDateFrom,lcDateTo,lcMonth,lcYear,cYearMon,cMonthName
*----------------------------------
lcDir = "'C:\ORC_PRG\NEW_ORC\'"
bkDir = "'C:\ORC_PRG\DATA\DEPED\'"
lcDateFrom = THISFORM.txtdateFrom.VALUE
lcDateTo = THISFORM.txtdateTo.VALUE
lcMonth = MONTH(THISFORM.txtdateFrom.VALUE)
lcYear = YEAR(THISFORM.txtdateFrom.VALUE)
*----------------------------------
IF isBlank(lcDateFrom) OR ;
isBlank(lcDateTo)
MESSAGEBOX("Please input correct fields.")
ELSE
DO CASE
CASE lcMonth = 1
cMonthName = "JANUARY"
CASE lcMonth = 2
cMonthName = "FEBRUARY"
CASE lcMonth = 3
cMonthName = "MARCH"
CASE lcMonth = 4
cMonthName = "APRIL"
CASE lcMonth = 5
cMonthName = "MAY"
CASE lcMonth = 6
cMonthName = "JUNE"
CASE lcMonth = 7
cMonthName = "JULY"
CASE lcMonth = 8
cMonthName = "AUGUST"
CASE lcMonth = 9
cMonthName = "SEPTEMBER"
CASE lcMonth = 10
cMonthName = "OCTOBER"
CASE lcMonth = 11
cMonthName = "NOVEMBER"
CASE lcMonth = 12
cMonthName = "DECEMBER"
ENDCASE
cMonthName = UPPER(LEFT(ALLTRIM(cMonthName),3))
cMonName = SUBSTR(cMonthName,1,3)
cYearMon = SUBSTR(DTOS(lcDateFrom),3,2)+cMonName
DO lcDir+"\deped.prg" WITH lcDateFrom,lcDateTo,cYearMon
USE crormain IN 0 SHARED NOUPDATE
SELECT COUNT(*) FROM crormain INTO CURSOR lnCnt
IF MESSAGEBOX("Extract Deped ORC?",36,"Confirmation") = 6
COPY TO bkDir+"\"+lcYear+"\"+cMonthName+"\orc_deped2_"+LOWER(cMonName)+lcYear TYPE XL5
COPY TO bkDir+"\"+lcYear+"\crormain2"
MESSAGEBOX("File [orc_deped_"+LOWER(cMonName)+lcYear+".xls] Created!")
ELSE
MESSAGEBOX('Extraction Cancelled')
RETURN 0
ENDIF
ENDIF
After I run this program I get an error of...
But deped.prg location is correct.
If I run deped.prg alone without the form, a pop up of details of the extract then I need to close it for the process to execute again then
But I only need the crormain that's why I USE it in my code
Is this the reason why I get the error or is it another?
Thanks for the replies!