Opening Other File Types From Within Access
Nov 16, 2004
I have a database application that I have to get to display some external PDF files.
I thought that I would create a command buttone and use that to open the files, but that doesn't want to work. Can anyone provide some thoughts on how to open a Word document or PDF file from within an access form? I only need to display it and then close the file so it doesn't have to be anything fancy.
Help
View Replies
ADVERTISEMENT
Jan 15, 2008
hello good afternoon.
i am trying to open different file types using ms access. the following piece of code i found would only open 'word' documents. how do i make this piece of code more flexible to open pdf documents and excel as well. as it is currently i have a txt field on my form and if the path in the txt fiels leads to a word document when i click a button the word file opens. i want it to open a pdf or excel doc if it was in the txt field
[code]
Sub OpenWordDoc(strDocName As String)
Dim objApp As Object
'Opens the document
Set objApp = CreateObject("Word.Application")
objApp.Visible = True
objApp.Documents.Open strDocName
End Sub
View 4 Replies
View Related
Oct 7, 2013
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.
Private Sub Command35_Click()
Dim dd As Integer
Dim fileDump As FileDialog
Set fileDump = Application.FileDialog(msoFileDialogOpen)
dd = fileDump.Show
Dim Yourroute As String
Dim yourrouteName
Yourroute = fileDump.SelectedItems(1)
yourrouteName = StrReverse(Yourroute)
yourrouteName = StrReverse(Mid(yourrouteName, 1, InStr(yourrouteName, "") - 1))
FileCopy Yourroute, "us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
Me.Drawing_Link = yourrouteName & " # us170fp00dataWBO_Tool_RoomDrawings" & yourrouteName
End Sub
View 1 Replies
View Related
Oct 4, 2013
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
[Code] ....
View 3 Replies
View Related
Nov 24, 2005
Hi All
I'm not sure if this is even possible but I have a table which has a list of Categories(text) and another field named filepath(also text) which contains a file path which points to specific pdfs. So my question is Can I create a report which then prints the categories with a button next to them which if clicked on opens the coresponding pdf ?
Any help will really be apreciated I am a database novice but am really good at following instructions and copying code :)
Thanks in advance
Mel
View 3 Replies
View Related
Aug 26, 2005
I created an Excel file using:
DoCmd.OutputTo acOutputQuery, _
"Compile_Query", acFormatXLS, _
"G:ServiceCompanySanDiegoWarehouseLCDLine_Summa riesDaily" _
& DateMonth & DateDay & DateYear & ".XLS", False
However, after creating this excel file, i want it to automatically open.
Is there any way to do this in 97?
View 1 Replies
View Related
Apr 9, 2007
Hi
I am having trouble opening a file I created like 6 years ago. The verison has changed and I have changed computers. When I try to open the file I am receiving an error. That the current user account doesn't have permission to convert or enable this database. Is there a way to correct this? Thanks
View 1 Replies
View Related
Jan 27, 2005
I wish to open a specific MS Word file using a button on an Access form. Word opens OK, but how do I get it to open the particular file please?
Thanks
View 6 Replies
View Related
Dec 3, 2006
Hi,
I wonder if anyone here might be able to help me out here. I've been pondering this issue for so long and i was almost giving up.
I've been getting this warning everytime i open up an Access file (.MDB) especially, when trying to open up a file that's sitting on another computers. i have a few computers and they are set up in a peer to peer environment.
I took a printscreen of the warning message and attached it to this post. Please take a look at it. It's called "access.jpg"
Is there any way of turning it off? is it to do with the peer to peer networking?
Thank you in advance
View 2 Replies
View Related
Apr 22, 2007
I have an mde database originally created in Access 2003. Will I be able to open it in Access 2007?
(I ask because this mde file was originally created in Access 2002, and wouldn't open in A03. We had to track down the creator and get her to resend a new mde file that was 03 compatible. Are we going to run into the same problem after the next upgrade?)
View 1 Replies
View Related
Feb 17, 2012
Any module that would open a word document. Also, If that module could be linked to a ribbons menu item...
View 3 Replies
View Related
Sep 21, 2014
I am trying to program a button on my ms access form to open up an excel file.. So far the simplest code ive found online was from URL....
<code>
Private Sub Command57_Click()
Dim xlTmp As Excel.Application
Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open "C:Excel1.xls"
xlTmp.Visible = True
[code]...
However the code doesn't work, any way to open a file from within access?
View 1 Replies
View Related
Dec 20, 2012
Is there a way to open an Access Database from a batch file or VBS file wait for 20 seconds and then close the Access file. Preferably I would like the Access file to run in either invisible or minimized mode. I would like the Access Database to close again after the 20 seconds has elapsed.
(The reason for this is so that the Database can refresh itself from Sharepoint on another users machine so that the excel reports on his machine are up to date).
View 3 Replies
View Related
Dec 22, 2006
Hi All,
I have three excel files (ActualHires.xls, ActualPromotions.xls and
ActualSeparation.xls). These are password protected files (with the
same password). They are linked to an access database and whenever the
files are opened, one must supply the password and click the 'Enable
automatic refresh button.' What I was wondering was if this could be
done in access with a command button. I have pasted some code below
that I found but now I'm getting an error.
This is the code:
Dim BookNames As Variant
Dim B As Long
BookNames = Array("O:ExcelFilesActualHires.xls",
"O:ExcelFilesActualPromotions.xls",
"O:ExcelFilesActualSeparations.xls")
For B = LBound(BookNames) To UBound(BookNames)
WorkBooks.Open FileName:=BookNames(B), _
UpdateLinks:=3, Password:="*******"
WorkBooks(B).Close SaveChanges:=False
Next B
But when I click the button, I get this error:
Run-time error '9' Subscript out of range.
and this line is highlighted:
WorkBooks(B).Close SaveChanges:=False
Any help would be greatly appreciated.
Thanks.
View 1 Replies
View Related
Jul 15, 2014
Using Access 2007, can I return a value for CurrentProject.FileFormat WITHOUT opening the database?
I'm looking for a way to determine the file version of a given Access database without actually "opening" the database in Access (I don't want it to ever be visible at all or in any way).
So to open a database in Access 2007 "without opening it," I'm using:
Code:
Dim db As DAO.Database
Set db = DBEngine.Workspaces(0).OpenDatabase("C:Path-ToFile.accdb")
From here, there are at least two different "version" indicators that can be used, as in this example:
Code:
Debug.Print db.Properties("Version").Value
Debug.Print db.Properties("AccessVersion").Value
Now, if you run this code on an Access 2002/2003 .MDB file, you will get:
Code:
4.0
09.50
If you run this code on an Access 2007 .ACCDB file, you get:
Code:
12.0
09.50
Note two important factors:The db.Properties("Version") seems to be returning the JET version from what I can see in research. This is NOT what I'm after.
The db.Properties("AccessVersion") returns THE SAME VALUE for an '07 ACCDB as it does for an '02-'03 MDB, since Microsoft never updated it, apparently.
Now.... the one way that I have found that ACCURATELY describes the version of a given access database file is to use:
Code:
Debug.Print CurrentProject.FileFormat
...as this will always return, for example, 2.0 for an Access 2.0 .MDB file; 10 for an Access 2002/03 .MDB file; and 12 for and Access 2007 .ACCDB file (and there are others; these are AcFileFormat bitmask constants as described in Access support).
BUT, this CurrentProject object doesn't seem to be available (so far as I can see) when using the "open without opening" method described above.
SO, is there any way to return the FileFormat value without opening the database visibly? (Merely basing it in the extension isn't right either.... that would be easy but not accurate as several formats use MDB.
View 5 Replies
View Related
Aug 21, 2014
I have inherited a number of 2007 Access databases that have a PDF (Adobe Acrobat Document) as the file type for the locking record.
These databases seem significantly slower, and have more frequent "Not Responding" periods on the network - especially when compared to those with a standard ldb file type locking record.
What determines the file type for a locking record?
Can the Adobe locking record be changed to a ldb? and How?
View 9 Replies
View Related
Jan 26, 2014
Looking for a way to use transfertext to make a table and create a spec file from csv files I am importing. I want all fields in the table to be shorttext.
Otherwise I need another way to bring the files into a table.
I have a generic spec to use that brings in any data as text.
Created the spec from a delimited file with 255 text fields... Field001, Field002, etc.
However the field names need to be changed. My field names are in the first row of a table. I will need to read each fields data in the first row and rename the field.
View 1 Replies
View Related
Aug 14, 2015
Question: Is it possible, using VBA, to determine the actual Excel file type without opening the file?
I receive data files from other departments. Seems like every time someone changes their download structure, I end up with file types that do not match the download extension (example: xlm file with a xls extension). The files can't even be opened because of this. I think I can fix it if I could figure out how to determine what the file type really is.
I'm using Office 2010.
View 3 Replies
View Related
Dec 5, 2014
i had a database that allowed me from a form to store a file location for a record on a form, so i any time i could access the record, and then open the file, usually a pdf, it wasnt stored as a hyperlink, but as long text
i made the mistake of not copying the files for safe keeping when i got a permanent position..i am now back self employed, i need to recreate the database.
View 4 Replies
View Related
Feb 9, 2006
I am trying to do a comparison between two values and am getting the following error:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
The code that is creating the error is as follows:
sb = Request.Form("storyboardscreen")
if Not Lcase(Request.Form("AllStoryBoard")) = "all" then
whereClause = whereClause + "theStoryboard = " + sb
end if
I am using the statement to build the where clause of my query. The sb value is retrieved from a pull down menu and "theStoryboard" column is the db is of data type "text". The values stored in the field are 12 digit numbers. I have tried doing a cstr to sb but that doesnt work, any tips on what I am doing wrong? I am using asp with an access db....
Thanks
View 5 Replies
View Related
Apr 5, 2005
How to display field types of access tables in vba?
can any one show me how i can display display field types(like : phone integer ....) of
access tables in a text box using vba? I have no idea how i
can obtain that information using vba. Looking forward to your
replys.Thanks
View 1 Replies
View Related
Jun 11, 2007
I am very close to completing a DB Program.... How can I create a desktop Icon that will Launch my Program without Loading Microsoft Access along with it???
View 6 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 1 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 6 Replies
View Related
Jun 3, 2005
I am working in MS Access 2000. I have a query that is returning a table with various types of data. The problem is I can't seem to find anywhere in the Access GUI that will show me the data types of columns it has returned so I can't manually create a table to hold the values returned by query. Question is two fold:
1. Is there a way in Access SQL to import data returned from a query into a table that is not yet defined. Some like this:
a. Create a table that has a primary key but doesn't yet know the number of columns and/or data types of those columns.
b. Import the data from a query into this table and have it create the columns and copy the data types and populate the table while also numbering each row by primary key.
or
2. Is there a way to find out what the data types are for a table returned by a query in MS Access. I have checked the properites of the query and have been up and down the gui looking but I can't find a way while looking at the data returned by a query to explicitely see the data type (i.e., number, Date/Time, etc..) used by each column.
Any info would help. Thanks.
View 1 Replies
View Related
Jan 25, 2014
We have been using an Access (Access 2013) program where we link the program to dataviews created in sql server.
Recently we had to re-link the data views because a change had been made to them. When we relinked the data we noticed that the field type for the field used as the primary key changed from "Short Text" to "Long Text". The programmer who created the dataview from sql server said that nothing was done at that end that would have caused the change
I know how to prevent the problem from recurring. We are changing the sql server spec from VARCHAR(8000) to CHAR(20).
View 1 Replies
View Related