use vb code instead of the macro...
Code:
sub btnPrint_Click()
dim vFile, vTrain, vSec,vRpt, vDir, vName, vDat
dim i as integer
vDat = Format(now(),"yymmdd-hhnn")
vRpt = "rpt_R_Review
vTrain = me.cbo_T_Trainee
vSec = me.cbo_D_Section
vName = vRpt & "_" & vTrain & "_" & vSec & "_" & vDat & ".pdf"
vDir = "c:\" 'default folder
vFile = vDir & vName
vFile = Save1File (vFile) 'ask user where to save
i = InStrRev(vFile, "\")
vDir = left(vFile,i)
vFile = vDir & vName
'save new folder
docmd.OutputTo acOutputReport ,vRpt,"acFormatPDF",vFile
end sub
'save this code in a module for user to pick a folder to save to.
'note: user must enter ANY filename inside the folder to save to. Even if they change the default file name to "xyz", the code will save programmed file name into the folder.
Code:
Public Function Save1File(Optional pvPath)
Dim strTable As String
Dim strFilePath As String
Dim sDialog As String, sDecr As String, sExt As String
'===================
'YOU MUST ADD REFERENCE : Microsoft Office 11.0 Object Library, in vbe menu, TOOLS, REFERENCES
'===================
With Application.FileDialog(msoFileDialogSaveAs)
.AllowMultiSelect = False
.Title = "Save to"
.ButtonName = "SAVE"
.InitialFileName = pvPath
.InitialView = msoFileDialogViewList 'msoFileDialogViewThumbnail
If .Show = 0 Then
'There is a problem
Exit Function
End If
'Save the first file selected
Save1File = Trim(.SelectedItems(1))
End With
End Function