Johnnycat1
Programmer
I am using the following code to rename a report when it sends the object in an email. The issue is that if there are more than two words in the VendorName field it drops the last letter of the vendor name.
eg. The saved file name is "PO 15-1192-1r0 Prysmian Powe 20151120.pdf" in lieu of "PO 15-1192-1r0 Prysmian Power 20151120.pdf"
nanos gigantum humeris insidentes
A dwarf on the shoulders of giants...
eg. The saved file name is "PO 15-1192-1r0 Prysmian Powe 20151120.pdf" in lieu of "PO 15-1192-1r0 Prysmian Power 20151120.pdf"
Code:
If InStr(Replace(Me.Vendor, " ", Chr(255), 1, 1), " ") < 2 Then StrVendor = Replace(Me.Vendor, ",", "") Else StrVendor = Left(Replace(Me.Vendor, ",", ""), InStr(Replace(Me.Vendor, " ", "", 1, 1), " ") - 1)
nanos gigantum humeris insidentes
A dwarf on the shoulders of giants...