How To Get File Address Path Thru Windows Prompt?
Feb 2, 2006
Hi there!
I have a question:
Is it possible from a form to have a field (hyperlink - I suppose) where when the user cliks it opens windows prompt (like when you do a "Open" in a word document) and the he/she can select a desired file/folder then click OK (or something) and it puts the exact path to the previously selected file into the field!
Do you get what I mean? Is this possible?
Thank you for your help
View Replies
ADVERTISEMENT
Dec 3, 2014
Im seeking for a solution to prompt all user with windows alert for Notification
Case 1:One staff applied leave and clicked "Submit" , after clicked I want the system will prompt his/her Supervisor for his/her leave approval or like a notification that the Supervisor need to go somewhere to approve (Selected Supervisor)(Maybe the Supervisor need to 7x24 Opening the access database).
View 1 Replies
View Related
Oct 5, 2014
I've got the forms and queries in one .accdb file and my tables in a separate .accdb file. The forms file links to the tables in the tables file. The tables file resides in a folder called simply enough C:acc_tables and thats where i browsed to (obviously) when i set up the linkage.
One of the users does not wish (for whatever goddamn reason) to create a C:acc_tables file to stick the tables file in , and wants the tables file in some other folder.. Unfortunately this user does not have the skills to delete the existing links and re-link to the tables file after putting it in the folder he wants.
Where in the file that holds the forms and and queries do i find the path setting to the tables linked file? Can it be changed without deleting links and then re-linking?
View 4 Replies
View Related
Oct 28, 2014
I'm having another one of those days but I'm getting a file path and file name from a dialogbox and forgotten when the VBA property is to return the full file path and file name.
This code works fine for return the filename only:
Code:
Private Sub TEST()
Dim f As Object
Set f = Application.FileDialog(3)
f.AllowMultiSelect = True
If f.Show Then
For I = 1 To f.SelectedItems.Count
MsgBox Filename(f.SelectedItems(I))
Next
End If
End Sub
Instead of using 'Filename' what else can I use to return what I need?
View 3 Replies
View Related
Apr 25, 2008
Hi,
I know this can be done but I'm a novice at VBA. I have a batch file AutoLoop.bat which I run from command prompt at the moment. The idea is to run a VBA routine behind the onClick event of a command button in Access which would run this batch file in command prompt automatically. Say if the batch file path is I:AUTOGENLOOPGENAutoLoop.bat,
what VBA code can be used.
Thanks for any help.
View 1 Replies
View Related
May 15, 2015
The code below successfully saves a .pdf file to my c: drive. However, on occasion i want to overwrite a previously saved invoice e.g. 3815-140515-Bristol with an amended invoice but retain the same Invoice Number e.g. 3815-150515-Bristol.
Currently, if i save the invoice with the same invoice number but a different date it just saves down without overwriting the original invoice. Leaving 2 invoices with the same invoice numbers but with 2 different dates.
What I want to achieve is: Once I hit the SaveInvoice button the code will check that invoice Nr 3815 does not exist in c: drive and save normally. However, if it does exist a msgbox will then prompt me to overwrite.
Current code:
Private Sub SaveInvoice_Click()
'Save Invoice as PDF and annotate invoice number, site name, and date
Dim slFileName As String
' create the invoice as a pdf
slFileName = Me.txtInvoiceNr.Value & "-" & Format(Date, "ddmmyy") & "-" & Me.SiteName.Value & ".pdf"
DoCmd.OutputTo acOutputReport, "rptinvoice", acFormatPDF, ("c:CompanyName InvoicesRegular Invoices" & slFileName)
MsgBox "Your Invoice was successfully Saved"
View 2 Replies
View Related
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
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
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
Aug 3, 2005
How can i let a db find out the folder path, without its own file name, and save it in a variable?
merci
View 1 Replies
View Related
Apr 10, 2006
i am using file browser to save a file in MS ACCESS forms. However, i want another file browser to allow the user to specify the folder he wants, then from the folder he selects, i will generate a series of codes. Any advice on How can tat be done?
thks
FT :)
View 2 Replies
View Related
Mar 5, 2014
I'm importing a txt file using the following code.
Now my question is, how can I make visual basic ask me to select a file to get the path and put it in a string.
And use this string in the DoCmd.TransfetText
Code:
DoCmd.TransferText acImportDelim, "IN-specification", "tblimport", "C:usersKimdesktop extfile.txt"
View 1 Replies
View Related
Aug 10, 2014
I am trying to code a button to select a file path.I get a compile error: User-defined type not defined on the following line;
Code:
Dim fldg As FileDialog
View 7 Replies
View Related
Jan 12, 2015
Im trying to programmatically (without any user intervention) retrieve the long path name for a given file. It seems to me this should be a rather easy thing to achieve using Access VBA. Ive tried using various FileSystemObject methods with no luck. Ive Googled many variants of VBA get full path without any meaningful hits. provide the first string as a parameter to some object and have it magically return the second string.
String 1: C:PROGRA~2COMMON~1MICROS~1VBAVBA7VBE7.DLL
Stint 2: C:Program Files (x86)Common Filesmicrosoft sharedVBAVBA7
View 7 Replies
View Related
Oct 19, 2014
I want to deploy an access database at a small office with 5 computers, small network. However I do not intend to create a server in order to have a domain etc. Operating system is win 8.1 pro. Should I use a homegroup or workgroup ? Would it require password in case of workgroup? Which is a recommended way to setup this and keep some security like a guest cant access these files?
View 14 Replies
View Related
Jan 9, 2014
All of the sudden I get an error message when I try to open my database from a file rather than through Access. If I open Access first and open the file that way, there is no problem but if I click on it from Windows Explorer, I get the error.
See picture.
View 7 Replies
View Related
Mar 2, 2007
Hey guys,
How can I change the tables' splitted file path via vba?
Ex.: c: ables.mdb -> c:ew path ables.mdb
thank you.
View 3 Replies
View Related
Apr 25, 2007
Hi, I have a command button that opens a pdf file. However i will be distributing the database as a runtime package and need to account for people having different versions of adobe reader so need to search for the filepath string where Acord32.exe is found. This is the code I have but I am stuck! Ay help aprpeciated!
Private Sub Command4_Click()
Dim stAppName As String
Dim stPathName As String
Dim fs As Object
Set fs = Application.FileSearch
With fs
.LookIn = "C:Program Files"
.SearchSubFolders = True
.FileName = "AcroRd32.exe"
.Execute
????? stAppName = .FoundFiles
Set fs = Nothing
End With
'specify path name for version of adobe acrord32.exe
'stAppName = "C:Program FilesAdobeReader 8.0ReaderAcroRd32.exe "
stPathName = GetIniSetting("C:WINDOWSSSI_DL3_PROGRS.ini", "DIR", "REPORT_FILELOCATION") & "HOOF.pdf"
Shell stAppName & stPathName, vbMaximizedFocus
End Sub
View 1 Replies
View Related
Jun 14, 2006
Hi All,
I have been trying to figure this out for ages but I cant seem to get the code right or find any info on it.
In my database i have a mail merge on a button click which creates a new merged word document. I then need a way of when the user saves the document in word, bringing back the file path and putting it in a table called tblHistory with the correct customer ID in there too.
Any help appreciated
Thanks
Alex
View 1 Replies
View Related
Sep 29, 2014
In Access 2010 how to add a file path in the report footer?
View 4 Replies
View Related
Jan 10, 2007
Hello everyone and happy New year.
Ii have a database running on Access 10.0, I am using the insert hyperlink dialog box (access by Ctrl K) to allow users to insert a hyperlink to a file (could be any sort of file), into a text box.
The problem I have is most of the files are held many directories above where the database is (we have a BAD directory policy, 10's of folders within folders) and it gets a little painful to get the user to go up so many levels, due to the hyperlink dialog opening in the "current folder" view, ie where the db is located.
Simple quest, or so I thought. Can I change the default directory "Current Folder" that the dialog box starts in ?
I have already tried chdir"c:" but to no avail.......not that obvious then...
All help greatfully received...
Any help greatly received......
View 1 Replies
View Related
Mar 12, 2013
I am creating a database where I want to be able to browse to a file, select it and import it into a table. I am able to do this. BUt what I want to do is create a log of these imports and haveit include the path of where the file was inported from.
The field I am having issues with is the capturing the path of the file.
Below is what I am using to browse and import a file.
Private Sub Command5_Click()
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.Title = "Select the Excel file to import"
[Code] ....
View 5 Replies
View Related
Jul 31, 2013
I've recently created a new Access 2010 Database which I'm developing an interface for in VBA. I've created a new Userform in the Visual Studio (this required me to add the Userform button). I'm finding that when I insert the Multipage object which I need to use on the form I can no longer run the Userform. When I attempt to run, I get the error 'Path/File Access Error' followed by 'Run time error 75 - Could not find the specified object'.
It's definitely linked to the Multipage which I've inserted from the toolbox (standard object) as the form runs fine when it is not there and with other objects (have tested all other toolbox items). There is currently no code in written in the project, no tables or queries set up in the database therefore nothing is running when the form loads.
I've successfully used Multipages in a number of other VBA interfaces both in Access and Excel so not sure why they are causing a problem here. I've also just created a userform in exactly the same way in a new Excel sheet and it runs fine with the multipage.
View 1 Replies
View Related
Jul 22, 2012
I have a field on a form which the user currently has to manually type in the file path to a specific picture on a local drive. After the file path is entered, the path is linked and the picture is shown in an image box. I did this because I didnt want to bog the database down with attached files.
I wondered if I could have a browse button, which when pressed brought up the browse window to allow you to locate the image (using the standard windows browser). Then when you clicked ok, it writes the filename into the correct field on the form.
View 1 Replies
View Related
Jan 8, 2014
In my database i wanna use the DoCmd.CopyObject command with a button like as
DoCmd.CopyObject "Destination path can be browse and select file", "AcInformation", acTable, "AcInformation"
Image of the plane:
how can do this?
View 1 Replies
View Related
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