473,507 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access database with a Word-attachment...

4 New Member
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 7890
ADezii
8,834 Recognized Expert Expert
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
Annemarie
4 New Member
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
lordcenon
13 New Member
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 Recognized Expert Expert
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
1020
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
6019
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
3350
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
6260
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
2584
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
4898
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
2394
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
1666
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
2530
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
1537
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
7223
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
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.