From access I'm calling a code in excel. My code in excel pops up a browser that allows the user to select what files they'd like to import. For various reasons I have to import data through excel, not directly to Access which is why the browser appears in excel instead of access. Essentially the user will select a word file which is imported into access through excel.
I'd like this browser to appear in access instead of excel though. If I move my browser from excel to access is there any way to have my code in excel reference the file selected in access? Or is there some way for this browser to appear without the user having to select the excel icon in the task bar? I essentially want the user to only see and interact with access, but because my browser is in excel this isn't possible right now.
I want to find out how I can write VBA to find out if a default browser is open to a particular webpage. I guess I'm going to have to find the browsers handle but I also don't know where to go from there.
I want to open different .doc files by a button from access.
I want that the vba code checks where the current access database is located. In which folder the the current access database is.
In this file folder i have a folder called documents.
In this folder i have the .doc files.
Right now i have the following code.
Public Function getPath(ByVal iPath As String) Dim fso As Object Dim drive As String Set fso = CreateObject("Scripting.FileSystemObject") drive = fso.GetDriveName(CurrentDb.Name)
[Code] .....
The access database is in the folder Z:BUS MMM CGrimmMasterarbeitDatenbank
I want to delete an excel file from within access vba. Problem is that if the file is open, it obviously cannot be deleted. so I need to check to see if that specific excel workbook is open and if it is, I want to close it before I can delete it.
All of the answers here involve creating an excel object and opening it before closing it. If I do that all that happens is a second instance of the workbook opens then closes leaving the originally open workbook still open.
Sub xx() Dim XLapp As New Excel.Application Dim ObjXL As Excel.Workbook Set ObjXL = XLapp.Workbooks.Open("C:dropboxexcelimport.xlsx ") ObjXL.Application.Visible = True
[Code] .....
The above code demonstrates my problem, if the import.xlsx file is already open then the code just opens another instance of this workbook and then closes it again leaving the original workbook open and as such cannot be deleted.
I have created an action log database that sends an email when a new action is entered. I would like to launch the database using a hyperlink in the email, but can't seem to get it to work. All users have a copy of the front end on their desktop, so whatever I add to the email needs to launch the front end for any user signed on to their own desktop.
This is what I have and it sends a hyperlink but I click it, I get an error saying it can't find the file. I don't know how to word the path name for any user?
With obMsg .subject = "New action request for " & team .To = people
We have an access database which has a form that has a list box that details particular records. See attach "list box".
What I would like to do is double click on the record and this would look in a powerpoint folder (see attach "path") and open the presentation if there is a match to the value in Listbox Column 5 i.e. Tool Number.
I can get it to open the presentation if I include the tool number in the path but I cannot seem to be able to get it to compare the values and only open if there is a match.
From MS Access, I want to export my files to MS excel. However, i want to allow the user to open up windows file browser to select the folder n filename. Any advice on how can i go about coding this?
I recently upgraded a DB from 2003 to 2013 and ran into the following problem.
I have a button that opens a file dialog box and allows the user to upload a file to a predetermined location (and store the address as a hyperlink). I borrowed this code from someone else on here and modified it slightly.
In any case, the button still works, but now when it opens it doesn't have an option for "All files" under file types. So I can upload MS Office files, text files, etc., but not PDF files which are by far the most common types my users upload.
Here's my code and a screenshot is attached.
Private Sub Command35_Click() Dim dd As Integer Dim fileDump As FileDialog Set fileDump = Application.FileDialog(msoFileDialogOpen) dd = fileDump.Show
I want to put a File Browser on a form so my users can browse their desktop for the correct TXT file they want to be imported into the database. At first, I did nto think this would be hard but it seems as though it is some what of a challenge.
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?
I have a button in the form of the current access file. What I want to do is when the user click on the button, triggered the vba to backup current access file. But since the file is currently open, is this possible? If yes, may I know how to do it with vba?
I have tried two methods but failed: 1) Use copytofile method, but I get permission denied due to file open; 2) Use dbengine.compactdatabase method, but it also has problem if the file is open.
I have a query that opens a listbox in a form. In the listbox I want to add a doubleclick event that opens a pdf document with the selected record in it. The record is in column 1 of the listbox.
I can't use the FollowHyperlink method of the colecction application due the record in the column is a Key. I am not sure if FollowHyperlink method can be used in a listbox
I have been checking codes in the web and I found this:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long ShellExecute Me.hwnd, "open", "D:SebDesktopGA-BDpdf est.pdf, "", "", 4"
However, I don't know how to organize the code in a logic way in Sub End Sub. Neither I don't know if the code is for the doubleclic event in the list box or a Module. If is for a module I don't know how to write the code in it.
I would like to have a button in a form that the end user clicks and they then enter the name of the tif file they are looking for and on pressing enter the file is searched for and if found it is automatically opened up for them to see, if it is not found then a message "File Not Found" is displayed.
I Believe that I will need something like this:
Code:
Dim FS As FileSystemObject Dim filenum As Integer Dim tmp As String Dim Folder As Folder Dim subFolder As Folder Dim File As File
[Code] .....
It's when I get to this point that I've got stuck, I don't know how to structure the code required to do the search and on finding the tif file open it.
An example tif file I might search for is: 0H214_2CJ0001905.tif.
I have a .mdb file that was created with Access 2000. Before I upgraded to 2003, I opened the file source by holding down 'shift' and double clicking the file. Now when I do that, it runs the application. How can I open the source file again.
What I want to do is... open a file dialog from VBA "This of cause is no problem" the file dialog is opened from a double click function of a textbox holding a link to a picture, what i want to happen is... when the explorer opens I want it to show only the picture that was linked in the textbox.
Example "C:markPhotosPicture 085.jpg"
the code i have so far is as follows...
Private Sub FilePathLbl_DblClick(Cancel As Integer)
Dim fFile As String Dim fd As Office.FileDialog Dim retVal As Variant Set fd = Application.FileDialog(MsoFileDialogType.msoFileDialogFilePicker)
[Code] ....
It opens in the correct folder but it shows all the pictures in that folder.
I am trying to display an open file dialog window so that the user can pick up a file. I wish the window to show a specific folder. How can I do this? The code I am using is below. The parameter InitialFileName has no effect on the outcome.
Code: Function GetFileName(strPath As String, imtype As String) As String On Error GoTo Err_GetFileName Dim Dlg As FileDialog Dim sfl As FileDialogSelectedItems Dim sflitem As Variant Set Dlg = Application.FileDialog(msoFileDialogFilePicker)
Does anyone know where I can find a sample db that will let the user do the following:
Selected a file from their computer and upload to a the same folder as the db?
I am building an Investigation database. This function will allow the user to attach file to an investigation. (the files will be stored in a folder and logged on a table)
Hi, I am trying to open an access database (Access2002) from my computer ( C: est ) and I receive the error : Microsoft Access cannot open this file. This file is located outside your intranet or on an untrusted site.
We have a database on our network server which I cannot open. I get the following error everytime I try to access it.
This file is located outside your or on an untrusted site. Microsoft Access will not open the file due to potential security problems. To open the file, copy it to your machine or an accessible network location.
I think it has to do with a Microsoft Jet 4.0 Service Pack 8 security update. However, I cannot find the update to uninstall. Others can access the database located on the network, but some get a pop-up that allows them to say "no" and access the file. The pop-up has the following message:
Security Warning: Unsafe expressions are not blocked. Do you want to block unsafe expressions?
The file is part of a students exam, so a bit urgent!
The file just will not open, either by double click or open in Access. Tried holding shift, not the problem, not hidden or anything, just that trying to open brings up the first warning box (we have very strict security on students computers!) but after that nothing, no sign of an error or anything having been loaded. Tried compress & repair and the microsoft tool for compressing JET files, that did give an error when it tried, just saying error compacting database.
I've tried importing the file into a new database using access, that gives no results, but importing tables into excel does!
Anyone anyideas short of paying for it to be done?
Is it possible to open a pdf file that has been saved on a server?
What I have is a table that lists all of the files that have been saved to pdf. There is a column in that table that lists the exact path and file name. There is a combo box on a form that lists those file names. I need to know if there is VB code that will use that specific file name listed in the combo box and open (to view) the pdf file on the server.
Thank you so much for any help and insight provided.
I have a lot of pdf file that we save every day and name them like this 8012012,8022012, that are 2 digits day, 2 digits month and four digits of years no slashes. The fields are txt fields that we receive from banks. After processing their data, the upper management wants me to open those pdf files form access . I have created form named frmOpenPdf, placed text box named txtName and placed also command button named cmdOpen . I research code over internet and here is below, but it doesn't work;
Dim avCodeFile As CAcroAVDoc Dim MYSRTING As String MYSTRING = txtName.Value Set Acroapp = CreateObject("AcroExch.App") Acroapp.Show Set avCodeFile = CreateObject("AcroExch.AVDoc") 'This is the code file avCodeFile.Open "C:Documents and SettingsDesktopETFPdfFilesMYSTRING.pdf",
I would like to have like this : an user types 08012012 and the code execute to open file names 0802012 in command button .