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 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.
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.
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
- '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: 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: 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,...
|
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...
|
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...
|
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...
|
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...
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |