Hi,
I am hoping someone can help me.
I have build a database in Access but have only one thing that I can't do. Its a database for work which contains both personal and work-related info.
I need to attach a Word doc to every employee entered in the database. Only problem is, for every employee it has to be a different document.
Also there has to be a button with which the person filling the database can search for the right document and add that without any trouble.
Then there has to be a button for the person looking at the information in the database to either put in another document (if necessary), and open the word document and alter that.
Does anyone know if this is possible and if so, how do I do this?
Annemarie
4 7878
Hi,
I am hoping someone can help me.
I have build a database in Access but have only one thing that I can't do. Its a database for work which contains both personal and work-related info.
I need to attach a Word doc to every employee entered in the database. Only problem is, for every employee it has to be a different document.
Also there has to be a button with which the person filling the database can search for the right document and add that without any trouble.
Then there has to be a button for the person looking at the information in the database to either put in another document (if necessary), and open the word document and alter that.
Does anyone know if this is possible and if so, how do I do this?
Annemarie
How about a button that opens a standard Office File Dialog Box from which you can select a file and store its Absolute Path internally then another button that will actually Open the File for Viewing/Editing if so desired. If this is what you are requesting, let me know and I'll start work on the coding. It may, however, be a little involved. The other option would be to store the actual Word Documents in an OLE Object Field which would initiate its own set of problems given what you would like to achieve.
How about a button that opens a standard Office File Dialog Box from which you can select a file and store its Absolute Path internally then another button that will actually Open the File for Viewing/Editing if so desired. If this is what you are requesting, let me know and I'll start work on the coding. It may, however, be a little involved. The other option would be to store the actual Word Documents in an OLE Object Field which would initiate its own set of problems given what you would like to achieve.
This is exactly what I want :) One button for the one filling in the database and one for the one viewing the database.
If you could find the coding for me I would be most grateful.
Annemarie
Hi,
I am hoping someone can help me.
I have build a database in Access but have only one thing that I can't do. Its a database for work which contains both personal and work-related info. I need to attach a Word doc to every employee entered in the database. Only problem is, for every employee it has to be a different document.
Also there has to be a button with which the person filling the database can search for the right document and add that without any trouble.
Then there has to be a button for the person looking at the information in the database to either put in another document (if necessary), and open the word document and alter that.
Does anyone know if this is possible and if so, how do I do this?
Annemarie
I have done this in VB, but I am sure this would work the same in MS Access no matter what the version.
1) In your table, create a new field as Text with 255 length as maximum or to your desired len if you are sure. This field would contain the path for the MS Word document field.
2) Create a button that once pressed will ask you to input the path and filename of the Word document
3) Another button that will launch the MS Word application program with the path and filename as its parameter This is one of the method. If this is what I understand to your problem, let me know, I may have additional method to do it.
So everytime a new person is displayed on screen, you can specify, modify or call MS Word application to open up a given path and filename of the document.
Regards.
This is exactly what I want :) One button for the one filling in the database and one for the one viewing the database.
If you could find the coding for me I would be most grateful.
Annemarie
- 'Must set a Reference to the Microsoft Office XX.X Object Library and
-
'must be working with at least Access 2002
-
-
'Set up the File Dialog Box
-
With Application.FileDialog(msoFileDialogFilePicker)
-
With .Filters
-
.Clear
-
.Add "Word Documents", "*.doc"
-
End With
-
.AllowMultiSelect = False 'only 1 File allowed to be selected
-
.Title = "Select a Document For Form Entry" 'can change
-
.ButtonName = "Open Document" 'can change
-
.InitFileName = vbNullString 'can change
-
.InitialView = msoFileDialogViewDetails 'can change
-
-
'if the Show Method returns True, the User selected a File
-
If .Show = True Then
-
For Each varFile In .SelectedItems
-
Me![txtDocument] = varFile 'place the Absolute Path of the selected fileinto the [txtDocument]
-
'Field. Set its Control Source to a Field [TEXT] in the underlying
-
'Table
-
Next
-
Else
-
MsgBox "No Document was selected", vbExclamation, "No File Found"
-
End If
-
End With
Decided to go the simple route rather than the more complex one. In the Click() Event of a button named Load Document next to you Document Field (let's say [txtDocument], place the following code. Once you have entered Documents into the Database, and you have successfully opened them, this Field should be locked for obvious reasons. - Dim varRet As Variant
-
-
'If there is no value in the the [txtDocument] Field
-
If IsNull(Me![txtDocument]) Then
-
MsgBox "There is no Document to Load", vbExclamation, "No Document Listed"
-
Exit Sub
-
End If
-
-
Does the File and Path stored in the Database actually exist on the Local/Network Drive?
-
If Dir$(Me![txtDocument]) <> "" Then 'File does physically exist
-
'Default location of the Microsoft Word executable, change if necessary
-
varRet = Shell("C:\Program Files\Microsoft Office\Office\winword.exe " & Chr(34) & Me![txtDocument] & Chr(34), vbMaximizedFocus)
-
Else 'File does not physically exist
-
MsgBox Me![txtDocument] & " does not exist in the specified Directory", vbCritical, "File Not Found"
-
End If
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jan Smit |
last post by:
In Word I've written labels . I've convert this file from word to text. Now
I want to import those data in a Access database , but I don't get the
separate fields filled
Who can help me to...
|
by: MHenry |
last post by:
Hi,
We were going merrily along for 6 years using this database to record
all client checks that came into our office, including information
about what the checks were for.
Suddenly, network...
|
by: svdh2 |
last post by:
Dear All,
I have lately strugled more and more with Access, what started as a
simple database has brought me to the fundaments of Access.
I need to transfer fields from various tables to a...
|
by: Dadio |
last post by:
Hello
On my Access database form I have a command button which opens a Word mail
merge document in which I have created a number of fields (Title, FirstName,
LastName, Address1 etc.)
I would...
|
by: rick m |
last post by:
We have a fairly good sized Access database that contains some info on
the children our agency sees. We also have 40+ templates that require
some info from the database be inputted into them, such...
|
by: ashkash |
last post by:
I have an access database which takes information from a user and then uses the mail merge functionality to merge the data into a word document. I have a lot of subforms in the access database which...
|
by: RSH |
last post by:
Hi,
I have a situation where I have created a little application that makes an
Access database from a SQL Database for reporting purposes. it does the job
well, but it seems a bit slow. Is...
|
by: jason301 |
last post by:
I have started to get a problem when mail merging from my access database to word.
When I mail merge the database password is requested to proceed which is odd as the database is already open.
...
|
by: Quiris |
last post by:
Hello,
I have a Ms Access database, and linked some Ms Word documents to it,
so I can print the data in the database nicely into a letter.
In Word, I can search for a certain record of my...
|
by: ellischristina |
last post by:
Hello. I am trying to find a legal type database that includes the ability to have multiple party information sections or pages. i.e. a petitioner and a respondant.
Hopefully it would allow...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |