0

I'm trying to save a template on a specific place. For example, if a product have the GnrSerie = 1000, it should go to that folder, and then the if the Gnr = E2000, it should go to that folder and then name the file GnrSerie + "-" + Gnr.

I use the following code to save the file:

  .SaveAs "CAN'T SHOW THIS\" & rst![GnrSerie] & "\" & rst![Gnr] & "\" & rst![GnrSerie] & "-" & rst![Gnr], wdFormatDocument

Further more, I am connected to the databases/tables where GnrSerie and Gnr is placed

Dim rst As DAO.Recordset
Dim sql As String
Dim db As Database

Set db = CurrentDb

sql = "SELECT * FROM Projektdata WHERE Sagsnr Like '*" & Forms!Sag_Form!SagNr & "*'"
Set rst = db.OpenRecordset(sql, dbOpenDynaset)

When I run it, it just pops up and ask me where I want to save the file.

Erik A
  • 31,639
  • 12
  • 42
  • 67
Uppah
  • 148
  • 12

1 Answers1

0

You probably will have to specify the drive as well:

.SaveAs "D:\CAN'T SHOW THIS\" & rst![GnrSerie] & "\" & rst![Gnr] & "\" & rst![GnrSerie] & "-" & rst![Gnr], wdFormatDocument
Gustav
  • 53,498
  • 7
  • 29
  • 55
  • The thing is that I have to save it on an online drive and not a local one. – Uppah Jan 05 '16 at 08:10
  • Also I get the error "This action cannot be completed because the application() is not responding. Choose to switch To to activate and correct the problem". When I click on the "Switch" button, I get the box where I can save it where I want, which is not the thing I want. – Uppah Jan 05 '16 at 08:26
  • It seems as there is no way around specifying the full path. Thus, you have to obtain that path before calling `.SaveAs`. – Gustav Jan 05 '16 at 08:41