473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access database with a Word-attachment...

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
Feb 1 '07 #1
4 7878
ADezii
8,834 Expert 8TB
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.
Feb 1 '07 #2
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
Feb 5 '07 #3
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.
Feb 6 '07 #4
ADezii
8,834 Expert 8TB
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
Expand|Select|Wrap|Line Numbers
  1. 'Must set a Reference to the Microsoft Office XX.X Object Library and
  2. 'must be working with at least Access 2002
  3.  
  4. 'Set up the File Dialog Box
  5. With Application.FileDialog(msoFileDialogFilePicker)
  6.   With .Filters
  7.     .Clear
  8.     .Add "Word Documents", "*.doc"
  9.   End With
  10.    .AllowMultiSelect = False    'only 1 File allowed to be selected
  11.    .Title = "Select a Document For Form Entry"  'can change
  12.    .ButtonName = "Open Document"                'can change
  13.    .InitFileName = vbNullString                 'can change
  14.    .InitialView = msoFileDialogViewDetails      'can change
  15.  
  16.      'if the Show Method returns True, the User selected a File
  17.      If .Show = True Then
  18.        For Each varFile In .SelectedItems
  19.          Me![txtDocument] = varFile     'place the Absolute Path of the selected fileinto the [txtDocument]
  20.                                         'Field. Set its Control Source to a Field [TEXT] in the underlying
  21.                                         'Table
  22.        Next
  23.      Else
  24.        MsgBox "No Document was selected", vbExclamation, "No File Found"
  25.      End If
  26. 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.
Expand|Select|Wrap|Line Numbers
  1. Dim varRet As Variant
  2.  
  3. 'If there is no value in the the [txtDocument] Field
  4. If IsNull(Me![txtDocument]) Then
  5.   MsgBox "There is no Document to Load", vbExclamation, "No Document Listed"
  6.     Exit Sub
  7. End If
  8.  
  9. Does the File and Path stored in the Database actually exist on the Local/Network Drive?
  10. If Dir$(Me![txtDocument]) <> "" Then    'File does physically exist
  11.   'Default location of the Microsoft Word executable, change if necessary
  12.   varRet = Shell("C:\Program Files\Microsoft Office\Office\winword.exe " & Chr(34) & Me![txtDocument] & Chr(34), vbMaximizedFocus)
  13. Else    'File does not physically exist
  14.   MsgBox Me![txtDocument] & " does not exist in the specified Directory", vbCritical, "File Not Found"
  15. End If
Feb 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
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...
10
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...
4
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...
4
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...
5
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...
1
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...
4
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...
1
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. ...
1
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.