if dstartdate = { / / } or denddate = { / / }
messagebox("Invalid Parameters - Include Startdate, Enddate",16)
.formerror()
return
endif
endwith
select vendcomply.vcid, vendor.vncontact, vendor.vnname, vendor.vnaddress1, vendor.vnaddress2,;
vendor.vncity, vendor.vnstate, vendor.vnpostal, iif(vendcomply.billpo=1,"PO #","" as viol1,;
iif(vendcomply.billpallet=1,"Pallet Count","" as viol2, iif(vendcomply.billcarton=1,"Carton Count","" as viol3,;
iif(vendcomply.lblpo=1,"DDS PO# on Label","" as viol4, iif(vendcomply.lblsku=1,"DDS Sku# on Label","" as viol5,;
iif(vendcomply.lbldesc=1,"Item Desc on Label","" as viol6, iif(vendcomply.lblum=1,"U/M per Carton","" as viol7,;
iif(vendcomply.palstandar=2,"Sub Standard Pallets","" as viol8, iif(vendcomply.pallblexp=1,"Carton Labels Exposed","" as viol9,;
iif(vendcomply.paldimenio=1,"Product Contained to Pallet Dimenions","" as viol10,;
iif(vendcomply.paldamage=2,"Product Damaged due to Improper Shipping","" as viol11,;
iif(vendcomply.pklist=1 ,"Packing List Included","" as viol12, iif(vendcomply.pkonlead=1,"On Lead Carton","" as viol13,;
iif(vendcomply.pksku=1,"DDS Sku# on Packing List","" as viol14, iif(vendcomply.pkpo=1,"PO# on Packing List","" as viol15,;
iif(vendcomply.repack=1 ,"Re-Pack was Required","" as viol16, iif(vendcomply.carrier=1,"There was a Carrier Issue","" as viol17;
from Vendorcomply;
join vendor on vendor.vncode = vendcomply.vendid;
where vendcomply.vcdate between dstartdate and enddate;
order by 3,1;
group by 3,1;
into table (sys(2023) + "\Testdata"
copy to c:\VFP\Testdata.dbf delimited
public oword
oword = createobject("Word.Basic"
with oword
.appshow && Makes Word Visible
.filenewdefault && Opens up blank Word document
.mailmergemaindocumenttype(0) && the active window a document
* Open the data source
* The following command uses C:\VFP as the path
* to the data source
* Activates the mail merge main document
.mailmergeeditmaindocument
* The following Insert commands place text into the Word
* document. You can change these commands to place any text in
* the document. This example uses a typical business letter
* format.
return
.insert("550 College Terrace" && Inserts a string
.insertpara && Inserts a carriage return
.insert("Orangeburg, SC 29915"
.insertpara
.insertpara
.insertmergefield("vnname"
.insertpara
.insertmergefield("vnaddress1"
.insertpara
.insertmergefield("vncity"
.insert(", "
.insertmergefield("vnstate"
.insertpara
.insertmergefield("vnpostal"
.insertpara
.insertpara
.insertpara
.insert("Dear "
.insertmergefield("vncontact"
.insert(","
.insertpara
.insertpara
.insert("Thank You For Your Support."
.insertpara
.insertpara
.insertpara
.insert("Sincerely,"
.insertpara
.insertpara
.insertpara
.insert("Traci Graski"
* Merges data records with the main document
.mailmergetodoc
* Saves the active document with the specified name
.filesaveas("c:\lett.doc"
endwith
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.