when i create a bill on materials the file goes into the first location i have listed which is my folder path
\\192.168.2.11\contdocs\Engineering\material list in pdf
now they want to move it to another location listed below
\\192.168.2.11\contdocs\Engineering\Document libraries\approved documents-controlled\product library-controlled\ ????
the product numbers are as below as you can see the first Charectors could be different
how can the code be changed so a folder is created where i have put the ??? marks
thanks
Products Products
\\192.168.2.11\contdocs\Engineering\material list in pdf
now they want to move it to another location listed below
\\192.168.2.11\contdocs\Engineering\Document libraries\approved documents-controlled\product library-controlled\ ????
the product numbers are as below as you can see the first Charectors could be different
how can the code be changed so a folder is created where i have put the ??? marks
thanks
Products Products
Product No |
---|
AC4619M1 |
DC4521M1 |
WE4573M1 |
AZ4636M1 |
EC1363M1 |
Code:
On Error GoTo Err_Handler
Const FOLDER_EXISTS = 75
Const MESSAGE_TEXT1 = "No current product ."
Const MESSAGE_TEXT2 = "No folder set for storing PDF files."
Dim strFullPath As String
Dim varfolder As Variant
If Not IsNull(Me.Product_No) Then
' build path to save PDF file
varfolder = DLookup("Folderpath", "pdfFoldere")
If IsNull(varfolder) Then
MsgBox MESSAGE_TEXT2, vbExclamation, "Invalid Operation"
Else
' create folder if does not exist
MkDir varfolder
strFullPath = varfolder & "\" & "Product Number " & " " & Me.Product_No & " " & "issue " & " " & Me.issueNo & ".pdf"
' ensure current record is saved before creating PDF file
Me.Dirty = False
DoCmd.OutputTo acOutputReport, "material list in pdf", acFormatPDF, strFullPath
End If
Else
MsgBox MESSAGE_TEXT1, vbExclamation, "Invalid Operation"
End If