0

I have a button in MS access to export an OLE word document.

 Private Sub Command25_Click()
    Set OLEobj = Me.POLICY_OLE
    OLEobj.SaveAs Me.TRANSACTION_TYPE.Value & Me.TRANSACTION_NUMBER.Value & ".doc"
    Set OLEobj = Nothing
End Sub

This is working fine but I would like to define the file path say

C:\Me.TRANSACTION_TYPE.Value & Me.TRANSACTION_NUMBER.Value & ".doc"
Kostas K.
  • 8,293
  • 2
  • 22
  • 28
  • So concatenate drive reference literal text with variables, just as you are with ".doc": `"C:\" & `. But tries to save a root. So expand that with whatever path you want. If you want to allow user to select folder, then use FileDialog. https://stackoverflow.com/questions/16917122/defaulting-a-folder-for-filedialog-in-vba – June7 Mar 18 '21 at 17:43
  • Thanks it worked i must have missed adding the '&' – Thomas Mifsud Bonnici Mar 22 '21 at 08:17

0 Answers0