Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS ACCESS






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Recall - Export To MS Word


I have a template fax set up in Microsoft word and want to be able to export fields from my database (in form view) to the word document. For example, I have a 'purchase order No' on the access form which I want to send to the Word document. When exported I then want the user to be prompted to save the document as a new name so they do not overwrite the original template fax.

Any ideas guys,
Cheers,
Recall.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Export To Word
Boy am I frustrated.

I have searched the forums for similar problem but I was unable to find it.

I have some buttons that export the data from a form into a Word Document. It generally works but there are some issues.

I have Access 2003 but the people using it only use the runtime version of Access and the environment is Office 2000.

I have copied code from other examples and maybe missing something that is causing the issues.

1. When I export the record it is causing problems with the Normal.dot template. When I try to close Word it keeps asking me that I have modified that template. After pressing Cancel button twice it the save box disappears.
2. When I leave the code Dim objWord As word.Application I get an error message about a compile error User defined Type not defined.
2. When the users try to export a record to the specific word template I
created and a required field is empty an error message is displayed and then closes the application.

Any help will be appreciated. I am a newbie when it comes to code.

Sample code is below.
Private Sub Command1079_Click()
Dim objWord As word.Application
'Start Microsoft Word 2000.
Set objWord = CreateObject("Word.Application")

With objWord
'Make the application visible.
.Visible = False

'path and name of the template your are using.
' objWord.Documents.Add ("U:Asset Strategy and Commercial PropertyCommercial PropertyTaskmasterletterofobjection.dot")
.Documents.Open ("C:Documents and SettingsDadMy DocumentsWorkTaskmasterletterofobjection.dot")

'This is for the bookmark that you created in the template

.ActiveDocument.Bookmarks("bmSubject").Select
Selection.Text = Forms![frmTaskMaster_LeaseManagement]![Subject]
.ActiveDocument.Bookmarks("bmCurrentRent").Select
.Selection.Text = Format(CCur(Forms![frmTaskMaster_LeaseManagement]![CurrentRent]), "Currency")
.ActiveDocument.Bookmarks("bmVendetails").Select
.Selection.Text = Forms![frmTaskMaster_LeaseManagement]![VenDetails]
.ActiveDocument.Bookmarks("bmDateNotice").Select
.Selection.Text = Format(CDate(Forms![frmTaskMaster_LeaseManagement]![RentNotice]), "dd mmmm yyyy")
.ActiveDocument.Bookmarks("bmRentReviewDate").Select
.Selection.Text = Format(CDate(Forms![frmTaskMaster_LeaseManagement]![ReviewDate]), "dd mmmm yyyy")
.ActiveDocument.Bookmarks("bmAskingRent").Select
.Selection.Text = Format(CCur(Forms![frmTaskMaster_LeaseManagement]![AskingRent]), "Currency")

End With

Print_Reconsideration_Err:
'If a field on the form is empty, remove the bookmark text, and
'continue.
If Err.Number = 94 Then
.Selection.Text = ""
Resume Next

End If
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut

End Sub

View Replies !   View Related
Export Report To Ms Word
hi everybody,

I am new on the forum, i am from belgium
but also can speak english (i hope :-) )
I have a problem...

I have disabled all access buttons and rightmouse options
and menu bars; i have a button on my form thats shows a
report; what I want is when I press on the button, the report
automaticly goes to microsoft Word. How do i do that?
What must I put more into the code down here...
this is the on clink function

--------------------------------------------------------------------------

Private Sub cmdRapportGezocht_Click()
On Error GoTo Err_cmdRapportGezocht_Click

If strSQL = "" Then
MsgBox " Gelieve eerst gegevens te zoeken."
Exit Sub
End If

Dim stDocName As String
Dim lst As QueryDef

Set lst = CurrentDb.QueryDefs("qryOverzicht")
lst.SQL = Me.KzlActiesss.RowSource

stDocName = "rptGezochte" 'this is the report
DoCmd.OpenReport stDocName, acPreview

Set lst = Nothing


Exit_cmdRapportGezocht_Click:
Exit Sub

Err_cmdRapportGezocht_Click:
MsgBox err.Description
Resume Exit_cmdRapportGezocht_Click

End Sub
--------------------------------------------------------------------------

greetz

veerle

View Replies !   View Related
Export A Table Into Word
I have a table called "MPI_CODE" it has 4 columns. How can I export this to Word? By creating a new document first (Using Save dialog) then exporting that table to the word doc. Mainly looking for the code to export the table into word.

Thanks in advance for your help.

View Replies !   View Related
Export To MS Word Bookmarks
Hello friends, I have a good question for you.
I have a form in Access with a check box named chk1.
On the same form I have a code that export my data to a template in MS Word. I use bookmark to export my access data. No problem with regular data but cannot handle checkboxes. Basically I need help to export the check box value (yes or no) into a check box places in my word template. In this template I have a checkbox. If I doulble click in to it I get a window which allows me to bookmark the checkbox but when I export the access data, I will get a YES or NO priot to the checkbox in word. Is there any way I can solve this problem?

This is a sample of my code:

objWord.ActiveDocument.Bookmarks("chek1").Select
If Err.Number = 0 Then
objWord.Selection.Text = Me.chek1
Else
Err.Number = 0
End If

Is the probkem in the Selection.text?

Thank you.

View Replies !   View Related
Simple Export To Word Problem
Friend, I am using a code to export data from a table to a word document using bookmarks and have a problem with the SSN format.
When I export the ssn it shows in my word field in this way:
123456789. What I need it that it shows using the following format: 123-45-6789

This is the code:

objWord.ActiveDocument.Bookmarks("SSN").Select
If Err.Number = 0 Then
objWord.Selection.Text = Me.SSN
Else
Err.Number = 0
End If

Any help?

View Replies !   View Related
Export To Word Check Box Problem
Friends,

I am having problems in exporting data from my Access db to a word template.

On my form I have a check box named check1. On my word template a have a box into which I need to export the value I enter in the check box. My checkbox in word is bookmarked.

Something is not working proberly. The following code does not check the box. Any help?

objWord.ActiveDocument.Bookmarks("check1").SelECT
If Not IsNull(Me.check1) Then
objWord.ActiveDocument.FormFields("check1").CheckBox.Value = True
End If
objWord.ActiveDocument.Bookmarks("check1").SelECT
If IsNull(Me.check1) Then
objWord.ActiveDocument.FormFields("check1").CheckBox.Value = False
End If

I have played around with the code, changing teh Null values to If Me.check1 = "YES" etc... but still nothing.
Any idea?

Thanks.

View Replies !   View Related
Can I Auto Export Stuff From Word To Access
we run a family business and i do all the quotations.

i have an access database in which i record these quotations and whether or not we got the job or not, and i have to input all the data manually.

i wondered if i could set a word document so that it would automatically export certain areas of the quotation (like the date, who it was to, what work we are quoting for, how much it would cost, etc) into the correct fields in my database.

can it be done??

any replies will be much appreciated.

thanks

View Replies !   View Related
Convert Export As Text To Tab Delimited (Word Merge)
I had to delete a database so I exported selected records using export as a text file thinking I would get some sort of delimited text file that I could later use. Instead I got some sort of fixed length file with .............. between records and | between fields.

I'd like to convert this data to a tab delimited file.

How would I do this?

Thanks

View Replies !   View Related
Recall - Look Up Last Entry
I want to add a system of getting unique numbers into my database based on the month followed by a unique 3 digit code. For example, if it is February and this is the first record then the reference will read 02/001. Any ideas how I would go about doing this.
I've set up a seperate table called Reference numbers as these reference numbers will be used on any number of forms.

Cheers,
Recall.

View Replies !   View Related
Recall - Tab Sheet
I've got a tab form on a sheet, with jus 2 tabs on it. I want both the tabs to span half way across the whole sheet and for the tab titles to be centralised abd in bold. I've seen VB applications with it done, but is it possible in Access?

Cheers,
Recall.

View Replies !   View Related
Recall - 7 Records Into 1
I've set up a DB to monitor employee hours. I have an employee table with a relationship to work done (one record = one days of work), so everyday is a new record in the work table. This is fine to monitor daily work patterns. However I need to calculate weekly work and other calculations (such as sixth and seventh shift payments, 15%payments, 25% payments etc). Is there any way that I can create a query that will give me one record for an employee that gives me start and end time for a Sunday, same for a Monday etc.

In other words I want to put start and end time for a Sunday to Saturday ( 7 records) into 1 record at the end of the week? (for each employee in the DB.

Any ideas?

Recall.

View Replies !   View Related
Recall - Combo Box Values With VBA
How can I specify the list that appears in a combo box by programming it with VBA.
I have eight unbound text boxes on a form and I want a combobox to generate its drop down based on the values in these boxes.
I think I'd have to create 8 variables and take the values from these text boxes and assign to the variables. The bit I get stuck on is how to make these variables appear in the combo box list.

Please help,
Recall

View Replies !   View Related
Recall - Not Move To Next Control When Rtn
I do not want the cursor to move to the next control on a form when the user presses the enter key. It is a memo field and I want the cursor to move to the next line as it would in a word document.

Any ideas,
Recall

View Replies !   View Related
Recall - Simple Sum On Form
This is probably v. simple but is doin me head in.

I've got a form based on a query containing three figures (currency). I want a total box that will add the 3 up. On the query I've created a field called Total with the following:

Total:sum([Text1]+[Text2]+Text3])

When three figures are in it works fine. If one of the figures is not there it displays #Name. I could get the fields in the table to automatically display 0, but if a user deletes off the 0 I'm stuffed.

Where am I going wrong?

Recall.

View Replies !   View Related
Recall - Message For Sbaxter
Could you please post me the VBAunbound.zip file so I can start getting to grips with unbound forms within Access. All the links in the forum seem to take me nowhere.

View Replies !   View Related
Recall - Unbound Forms
I've been reading a bit on the site from users who are working with DB over the network and speed issues it brings. I've got the same problem over a Citrix network with a split DB. The speed issue comes when loading up a bound form. I've rewritten some of the code so that when a user leaves a form, instead of closing down, it simple gets hidden and things have speeded up a lot. However, the initial load of the screen on DB start up is v.slow.

I'm interested in finding out how to use an unbound form ad then associate it with the data when it has loaded. Can anyone give me any tips or point me in the way of a sample DB.

Cheers,
Recall.

View Replies !   View Related
Recall - Linked Table DB
I've created a linked table database which is running currently at my offices over a Citrix network. We want to put the database into 2 other sites (initially), however, the drive that all the sites see is slightly different for my site than the other sites (i.e. I see it as W: but they see it as P, but physically they are the same drive. Obviously, the links to the tables would have to be changed so the other FE could see the BE. I can't do this from my site as I cannot see the drive as they see it. I don't want them going into the FE design to update the linked table manager everytime I make changes and send them a new DB.
Does anyone know how (or have an example DB) to create a button on the FE that will ask the user to select the location of the BE with a file browser, for example and then update the table links.

Think this is a bit of a tough one, but I'm sure someone must have done it at some point.

Cheers,
Recall.

View Replies !   View Related
Recall - Password * In Input Box
I want to bring up an input box for a user to enter a password, but want the characters they key to appear as *. I can do the input box bit, just the * bit I'm unsure of.

Cheers,
Recall.

View Replies !   View Related
Recall - Hide Menus
How do I hide the built in Access menus on a DB? i.e. the file, edit, view etc.

Recall.

View Replies !   View Related
Recall - Unbound Form
I've been looking at Sbaxters example unbound form. I want the form to be unbound, but I also need the form to show the autonumber straight away when they create a new record, but the data they enter into the text boxes only gets written to the DB tables when they hit the Save button. Is this possible?

Also, on my forms I always have a record count (on the On_Current event) of the form. When they use the next button this changes to show 1 of 100 for example. If the form is unbound how do I get this to display how many records are in the DB or how many records have been found during a search.

Cheers in advance,

Recall.

View Replies !   View Related
Recall - DLookup Question
I've sussed out how to do DLookups now to find duplicates etc. What I want to do however is look for duplicates say in the primary key of a field and then return a message saying their is a duplicate (and return the company name for example) instead of just saying there is a duplicate.

To explain a bit better I have companies set up with codes to recognise them (which a user keys in). If a user keys in a code already used by a company I want a message to display there is a duplicate and tell them the name of the company this is already being used for.

Cheers in advance,

Recall.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved