Current Folder/path

Jun 11, 2006

Hi all

How can I change the output string in the command below to simply save the document to the same folder that the DB resides??

DoCmd.OutputTo acQuery, "qryAwardsExportWord", "RichTextFormat(*.rtf)", "C:dataawards.doc", True, "", 0

any help is appreciated

View Replies


ADVERTISEMENT

How To Open A Dialog Box To Move Files Inside A Folder That Is Setup As Current Folder

Sep 2, 2015

I'm trying to automate a process of selecting a set of file/s and move them in a folder. When I click on a button, it should open a current folder that is setup in the code.

Lets say that I have a folder C:documents est, and very time I click on the button, it should open the dialog box with that path so I can select the files from another folder, drag them there and they will be saved in that folder.

This will form part of wider automation that will send an email stating that those file/s where placed in that folder.

I have in the same form where the button is placed, 3 check boxes that needs to be passed to the email as well that one or all the files where placed in the folder.

View 10 Replies View Related

Folder Path To Variable

Feb 28, 2007

I have a form set up and I am looking to:

Set up a txtbox that will house a variable (no worries)

I want a button that when clicked to open a "MS Windows window" that allows the user to navigate to a folder. When done I need that path to be placed in the textbox I set up (Or to a variable)

Does that make sense?

I thank you all for your help it is very appreciated.

Thanks Again

View 4 Replies View Related

Forms :: Relative Folder On Image Path

Jul 10, 2013

I am trying to link an images (.png) onto a form. I have a folder of all the images I want but I want the path to be relative. So that if I move the access file and the images folder to a new location, it will still work.

In the properties for the image, It works fine as C:UsersjohnDesktopimage1.png but what I am looking for is the ability to use "imagesimage1.png" as the file will always be in that relative folder to the db.

What is the correct syntax for this? putting image1.png in the same directory and just using image1.png works, but this won't be very tidy with 100+ images.

I have tried:

imagesimage1.png
imagesimage1.png
imagesimage1.png

With PictureType set as linked.

I know from searching it is possible through VBA by getting the root directory of the folder and appending the filename. Don't really want to go this root. I also don't particularly want to create a table to store the images or links.

View 8 Replies View Related

Modules & VBA :: Adding Path Of Folder In Email

Jan 29, 2015

I have some code that takes data from my database and creates an email with it. It also creates a folder and a word document. In the email, I would also like to include the file path as a link instead of just the path that it puts there now. Is this possible to do?

Code:

Option Compare Database
Private Sub SendEmail_Click()
On Error GoTo Err_open_word_Click

Dim oApp As Object
Dim path As String

[Code] .....

View 1 Replies View Related

Modules & VBA :: Loop Through Folder - File Path Hyperlink

Nov 19, 2013

I am using MS Access 2010. I have a code that I am using that loops through a folder gather all the names of the files in the folder and inserts them into a table (shown below). The table is named "tblFiles" there are two columns in the table titled file name and file path. What I want to do is to also loop through the same folder to find the file path of the files and insert them into the file path column has a hyperlink where users can just click on the hyperlink and the file opens.

Private Sub Form_Load()
Dim fs, f, f1, fc, s
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblFiles")

[Code] .....

View 4 Replies View Related

Modules & VBA :: Universal Short File Path To Documents Folder?

May 27, 2014

I have the code below and I want it to open a file from my documents folder. The only problem is that every computers path is different to this folder. Any easy way to work around and open a file in My Documents without the full path?

I want to eliminate the part of the path in red and make it universal because computers will have a different number.

Operating System: Windows 7

Code below:

Public Function AddITARPicOffloadAnalysis()
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
With xlApp
Dim wb As Object
Dim ws As Object
Dim Lastrow As Long

[Code] .....

View 9 Replies View Related

Query For Current Database Path

Apr 27, 2007

I used to know how to get the path for the current database by running a query. I forgot how to do it. I am using Access 2003. I have tried querying the msystem tables without success. I have searched forums and the web without success. Anyone? Thanks!:)

View 1 Replies View Related

Get "folder Path" From "file Path"

Jul 29, 2005

After some help from one of the threads here I managed to install a Browse button in a form that inserts a file path to a text box. What I need is the folder path from that file path in another text box. For example if the file path is
C:Documents and SettingsmixupSketchesowl.jpg

I would like to get either
C:Documents and SettingsmixupSketches
Or,
C:Documents and SettingsmixupSketches
in my second text box.

I do not have much experience with Access; therefore please give a little detail on how to accomplish this.

Thanks.

View 9 Replies View Related

Auto Relink To Current Folder

Jan 20, 2007

I've searched the forums for days and I can't find exactly what I need to know, even though this is a very common topic, so if it's already been answered, I apologize.

My problem is simple. I have a database that tracks clients for me. I have a front end and back end in the same folder. Under normal circumstances, the static links that Access uses are fine. I just link from the front end to the back end and all is well.

But some other users of the database will need to track multiple people's clients. So instead of putting the database in c:database, I may need to have a copy in c:database, c:database2, c:database3, etc.

So what I need is a (hopefully) simple way to get Access to look for the backend in the current directory, no matter what that directory might be. It may be on a network drive, or the c: drive, or any of a dozen various subdirectories. And the users who will be using the database may be very computer illiterate, so I don't want to have any user intervention required.

And so that I'm not any more confused than I already am by any code you might offer up, the name of the database frontend is tracking.mdb and the backend is tracking_be.mdb

Any ideas? Thanks in advance. You'll make my week if you can figure this out with me.

View 11 Replies View Related

How To Replace Hard Coded Path Of Current Db

Aug 2, 2006

I have something like this
Code:'sets generic workspace Set ws = DBEngine.Workspaces(0) 'sets target database from workspace ******NOTE hardcoded path****** Set db = ws.OpenDatabase("E:Status ReportstatusReport_Test.mdb") 'sets Recordset to deliverablePercentComplete sql statement for target database Set rs1 = db.OpenRecordset(deliverablePercentComplete)

is there a way to replace the path in the set db call, basically it is the current database that is being worked on, thus it is the current database that is opened, is there a way to say something like...

set db = ws.OpenDatabase(currentDB)

View 1 Replies View Related

Modules & VBA :: Define Current Sub Folder Within Code?

Oct 9, 2014

I am trying to define a path to identify a current folder - I'll try and explain the way the following code works first (and it does work 100%)

The following code identifies folders and sub-folder structures and imports them (their structures and folder paths and filenames) into a DB

It also simultaneously retrieve's any xml docs within those respective folders and imports the XML data into the same database ........ and then moves those folders into a "processing folder" location.

Cool yes, but I can only import the XML doc's at the moment, by hard coding the path (like this):-

path = "C:UsersjeremybDesktopsnapmadXYZ123XYZFILES 0061940"

The code is highlighted as above - in the FULL code below:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Code Begins:-
Option Compare Database
Option Explicit

[Code]....

View 2 Replies View Related

General :: Saving Program To Current User Documents Folder?

Aug 31, 2014

I have an access program and i want it to save a copy into a location... ive got it so it can save however - i want it to save to the current users documents folder (win 7)

What file path would i use?

View 5 Replies View Related

Save Reports To Defined Path In Path Field

May 26, 2014

Till now I managed to publish and save all in C:Reports. What I'm trying to do is Save to path specified in Path. DB attached.

Private Sub PrintAll_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyPath As String
Dim MyFileName As String

[Code] ....

View 6 Replies View Related

Modules & VBA :: Open Folder Nested Inside Main Folder?

Mar 16, 2015

I'm trying to open a folder based on a BIN nr. This folder could be in a main folder that has diferent subfolder. As there where differnt naming used to create the folderes, one of the things they have always is the BIN nr. It alwasy start with a unique number and maybe I could use it to scan the subfolders and open that one that the BIN nr is equal as in the field BIN.

Now we have serveral 1000th of folders and finding them takes time.

View 3 Replies View Related

Forms :: Goto Form With Current User And Current Date

Aug 27, 2013

What I really need is for when the form opens, it looks at todays date, then matches current user and then goes to that record for today, if no current user there, then will goto new record..

i know, sounds complicated, and probably is really easy, but my heads not with it today, as about to get drunk as its my 40th, and got people ringing and texting and still trying to get this done....

I've included a copy of this database, named Timecards..

View 1 Replies View Related

Need Some Help With A Path

Aug 28, 2006

I have a split dbase and have been running the backend on a server which was linked using a mapped network drive letter and path.
Now I'm trying to connect it to a path like this. Is it possible?

\aaat.comFoldersUS-SitesNY-JunctionPassdown-passdownfilename.xxx

View 1 Replies View Related

Get App Path

Feb 22, 2006

Trying to get the app path of the database I have open to insert into my connection string. Currently using the following:

sPath = App.Path

Receive this error when debugging:

Run-time Error '424'

Object Required.

Thanks

View 2 Replies View Related

Path

May 12, 2006

Hi,

Ans1:
MyShortcut.TargetPath = "C:Program FilesMicrosoft OfficeOffice10Msaccess.exe "

Ans2:
MyShortcut.TargetPath = "C:Program Files..Msaccess.exe "

The Ans1 works fine.
The Ans2 doesn't work.

I want to work the Ans2, because every user machine's Office path is different.

For example:
MyShortcut.TargetPath = "C:Program FilesMicrosoft OfficeOffice10Msaccess.exe "

MyShortcut.TargetPath = "C:Program FilesMicrosoft OfficeOffice11Msaccess.exe "

MyShortcut.TargetPath = "C:Program FilesMicrosoft OfficeOffice12Msaccess.exe "

MyShortcut.TargetPath = "C:Program FilesMicrosoft OfficeOffice13Msaccess.exe "

So, I want to create the link with the target
MyShortcut.TargetPath = "C:Program Files...Msaccess.exe "

How can I do it?
Please let me know, thanks.

View 2 Replies View Related

Dialog Box Path

Oct 21, 2005

Hi all,

Can I set the default path for a dialog box to look in when called?

View 1 Replies View Related

Get Path Of File

Apr 5, 2006

I have a button that allows a user to select a file using the windows select file dialog using the following code:

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)

With fd
.Title = "Select A Text file to Import"
.Filters.Add "Text File", "*.txt"
.FilterIndex = 1
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show
If (result <> 0) Then
Me!txt_path = Trim(.SelectedItems.Item(1))
End If
End With

Is there a way that I can capture the path of the file they select in a separate text box?

Thanks!

Vassago

View 3 Replies View Related

Path Of Backend

May 25, 2006

Anyone know how to find the path of your backend database using VBA code?

I am trying to determine whether the application is using a database via a network path.

View 2 Replies View Related

Get Directory Path

Jul 13, 2006

Anyone got any ideas how to get the directory path where the database is running?
Thx in advance
Bob

View 2 Replies View Related

Specify Path To File With UNC

Mar 23, 2008

I went to the Microsoft knowledge base (304408) and found a routine that automatically logs off users with a short warning. It works fine, but depends on the presence or absence of a small text file which is named chkfile.ozx. The file is referenced in a form timer function as follows:

Dim StrFilename as String
strfilename = Dir("c:MyDirectorychkfile.ozx")

The function then tests for its presence and does its thing. You trigger the logoff by going in as sysop and changing the name of the file so it is no longer found.

The problem I have is that on the network, I use the backend file on the network and different users map different letters to it. I get around this by linking using UNC eg. \ServerNameSYSData_be.mdb.

I put the chkfile.ozx into this directory since all users presumably have access to it.

I tried changing the trigger function to

strfilename = Dir("\ServerNameSYSchkfile.ozx")

but the program doesn't recognize the presence of the file. When I map it as "F:SYSchkfile.ozx" it works, but since all users will not be mapped to "F", it really isn't a solution.

Does anyone know the proper syntax to include in the Dir method for UNC naming?

View 4 Replies View Related

File Path Help

Dec 13, 2005

Hi,

I nave a code which allows the user to upload a file to a folder "images". I want to be able to record the filename and path in a table called "attachments". But I am not sure how. Can anyone help


Private Sub Command0_Click()


Dim FD As FileDialog
Dim Name As String
Dim Name2 As String
Dim Pathx As String
Dim Path As String
Pathx = Me.Application.CurrentProject.Path & "Images"
Path = Me.Application.CurrentProject.Path
Set FD = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With FD
.AllowMultiSelect = False
'Add a filter that includes GIF and JPEG images and make it the second item in the list.
.Filters.Add "PDF", "*.pdf, 1"

'Sets the initial file filter to number 2.
'.FilterIndex = 2

If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Name = Dir(vrtSelectedItem, vbSystem)
Name2 = Pathx & Name
If Name2 = vrtSelectedItem Then
Else
FileCopy vrtSelectedItem, Pathx & Name
End If

Next vrtSelectedItem


Else
End If
End With
Set FD = Nothing

View 2 Replies View Related

Path Of An Image

Aug 22, 2007

Hi

I have a table with this fildes:
name - family - PathImage

I have 400 records.
and I have 400 pictures for 400 person to a folder

and I want fill them, but is an easy methode for finding and filling pathImage for each person? and insert it to table cell?

I want insert Name of image file to PathImage filde.
Is there any thing such browse bottom to find file name?


Thank for your lead

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved