Send Subform Contents To MS Word

Apr 21, 2006

can anyone tell we how to send the data from a subform to word, using a button on the main form? I'm using access 97

View Replies


ADVERTISEMENT

Modules & VBA :: Subform In Continuous Records Format - Send Contents Into The Body Of Email

Nov 10, 2014

I have a subform in Continuous Records format (records displayed are determined by controls on the parent). I would like to create a button that prepares an email and copies the contents of that subform in to the body of an email message.

The email. I have a method to create a new email, set To, CC, Subject and even Message Text.

Code:
strTo = txtName
strCC = txtManager
strSubject = "Something"
strMessage = "Hi, please find below list of details from X Y and Z" & vbnewline & vbnewline

That all works. Thats fine

The Records: I have found ways to have them added as an attachment, either the the SendObject and OutputTo method but I would like the list of records to be converted to a text string so I can include it within my strMessage variable, not include it as an attachment.

Code:
strMessage = strMessage & "Subform Records to go here"...

View 7 Replies View Related

Send Record To Word Document

Jun 8, 2007

OK - bit of a newbie here & maybe this question has been asked a thousand times but i can't find any answers that cover this question properly.

Basically i am writing an access database that stores contract information, contact details, orders etc etc. I want to take the Order Number field, along with the Client Name & Address etc and post it into a Word Mail Merge type document, then save that file as ordernumber.doc after checking to see whether it already exists.

I have successfully managed to send the information into word in a mail merge document & get it to save the file using the ordernumber.doc format, however it is saving it to mydocuments folder and i want it in a subfolder called orders (that does exist). It is also not checking to see if that file already exist and overwrites it if it does.

I want to change the path to where the file is being saved, check whether it exists already, then ask me whether i want to overwrite it or save as something else.

Any help would be most appreciated. BTW I am using Word & Access 2003.

*****THIS IS THE CODE I AM USING*****
Private Sub NewEternit_Click()
On Error GoTo NewEternit_Err

Dim objWord As Object

'Start Microsoft Word.
Set objWord = CreateObject("Word.Application")

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

'Open the document.
.Documents.Add ("\shentcDocuments and SettingsJohn.SHENTMy DocumentsTemplatesEternit Order Merge.dot")

'Move to each bookmark and insert text from the form.
.ActiveDocument.Bookmarks("orderno").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!ContractNo) & "/" & (Forms!frmOrderDetails!OrderNo))
.ActiveDocument.Bookmarks("Date").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!Date))

If Me.chkDeliverYard = False Then

.ActiveDocument.Bookmarks("ClientName").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!ClientName))
.ActiveDocument.Bookmarks("SiteReference").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteReference))
.ActiveDocument.Bookmarks("SiteAddress1").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress1))
.ActiveDocument.Bookmarks("SiteAddress2").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress2))
.ActiveDocument.Bookmarks("SiteAddress3").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress3))
.ActiveDocument.Bookmarks("Town").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!Town))
.ActiveDocument.Bookmarks("City").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!City))
.ActiveDocument.Bookmarks("Postcode").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!Postcode))

Else

.ActiveDocument.Bookmarks("ClientName").Select
.Selection.Text = "OUR YARD"
.ActiveDocument.Bookmarks("SiteReference").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress1").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress2").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress3").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("Town").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("City").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("Postcode").Select
.Selection.Text = ""

End If

'Print the document in the foreground so Microsoft Word will not close
'until the document finishes printing.
'objWord.ActiveDocument.PrintOut Background:=False

' Save the file using orderno field
Dim FName As String
FName = Forms!frmOrderDetails!OrderNo & ".doc"

'Quit Microsoft Word and release the object variable.
'objWord.Quit
'Set objWord = Nothing

End With


Exit Sub
**** END OF CODE****

View 4 Replies View Related

General :: How To Copy Picture On Attachment And Send It To MS Word

Jul 11, 2012

I want to copy the file stored on a attachment field (.jpg), so i can use it on a Word document as a picture.

I've tried it with bookmarks but no success:

' 'Paste the photo.
.ActiveDocument.Bookmarks("EidPhoto").Select
.Selection.Text = GetPath & "RE EIDPicture" & OwnerFullName & "_eid.jpg"

Then I only get the path of the file, Is there a control that i have to use?

View 1 Replies View Related

Modules & VBA :: How To Send Embedded Word Document As Email

Dec 17, 2013

I'm using ACCESS 2010. I have a form which is having a embedded word document. What I'm trying to do is i want to enable user to format a mail in the embedded word document which will contain rich text and screenshots then with a click of button an outlook mail should open and content of this document should be pasted there. Once user sends this email, I want to save content of embedded document in the database.

View 4 Replies View Related

Modules & VBA :: Send Form Fields To Word Template?

Jul 2, 2015

I have a form with fields that contain the address/postcode etc of the person in question, and I also have a template letter that needs to have said persons address/postcode etc at the sending stage after a button is clicked.

View 9 Replies View Related

General :: Bulk Mail Send With Different Mail Body Contents

Apr 26, 2013

I have a ms access table with two fields...tablename is ..."Addresses"..

Field1:= Employee_mail_id
Field2:= Leave_balance

What I need to do is that,I need to send individual mail (in Bulk) two each employee intimating their leave balances.
Is it possible to do it in vb .I want it to assign the codes in a button.

Below iss the code.

Dim r As Recordset
Dim email As String
Set r = CurrentDb.OpenRecordset("select * from Addresses")
Do While Not r.EOF
email = email & r(2) & ";"
r.MoveNext
Loop
r.Close
DoCmd.SendObject acSendNoObject, Null, Null, email, Null, Null, "Test subject", "Message body of the test letter", False, Null

View 2 Replies View Related

Check Contents Of Subform Fields

Mar 24, 2006

I have a repair database which I'm working on. On the main WIP form there is a subform stating the faults which have been logged against that unit. The unit can be scrapped at any time by hitting the SCRAP button, but if the unit has had it's faults successfully repaired, then it can then be FINALISED which means it can be shipped to the customer.

I need to be able to check the records in the subform, to look for faults which have not been repaired. When they are repaired, the text "PASS" will be present in the TEST_RESULT field. I want to be able to check the TEST_RESULT field for each fault to ensure they are all a PASS before I allow the unit to be FINALISED. Any ideas how I can do this? Or am I taking the wrong approach?

Thanks,
Gareth

View 10 Replies View Related

Forms :: How To Add Listbox Contents To A Subform

May 11, 2015

I have five list boxes set to a table in my database. Here is what a few rows in my table look like...

ID IngredientName IngredientType Cost
1 Ham Meat $1.23
2 Beef Meat $3.45
...... ....
27 Lettuce Vegetable $0.22
28 Onion Vegetable $0.12
..... ....
38 Mayonaise Sauce $0.13

The five listbox controls each show the list by the IngredientType, so one listbox shows vegetables, another Meat, and so on. Multi-select is turned on for each listbox. Here is what I want to do: In the form I want to have a subform that will show what the user clicks in listboxes. This running list, with an extra column next to it that will accept a number. Example: say the user selects 'Ham' from the meat listbox. The subform should then show 'Ham' and a space next to it where he can type an integer (allowing for more meat).

Subform:

Ham | 2
Lettuce | 1
Mayo | 1
Subroll | 1

If the user de-selects the item in the listbox I'd like the subform to delete the item from itself.

View 13 Replies View Related

Subform To Word

Jul 18, 2005

Okay, I searched prolly even hit my head over the keyboard several times to find something resourceful in context to what I am looking for. But I didn’t, if there is something out there and it didn’t appear during my search or I missed it by any chance. Then accept my apologies. Now here is the question.

I have a master form and a subform, now I am able to send my master form to word, and my subform is in the form of datasheet. And this datasheet has a combo box, so the user can select as my options as they want. I want these options to export to word with the master form. I tried doing that through doc variable and also as book mark, but the only thing that’s transferring is the first field. I know couple of ppl went through the same trouble to achieve the same goal as me. And they asked the same question but their queries were un-answered, is it something that can not be done??? I am sure there has to be a way to do this; I am looking for some assistance here. That I will really appreciate.

I know I have a topic going on for a while now, about the same topic. But seem like there is no point of bringing that thread up over again, and it’s kind of dead.

View 1 Replies View Related

Subform To Word

Jul 18, 2005

Okay, I searched prolly even hit my head over the keyboard several times to find something resourceful in context to what I am looking for. But I didn’t, if there is something out there and it didn’t appear during my search or I missed it by any chance. Then accept my apologies. Now here is the question.

I have a master form and a subform, now I am able to send my master form to word, and my subform is in the form of datasheet. And this datasheet has a combo box, so the user can select as my options as they want. I want these options to export to word with the master form. I tried doing that through doc variable and also as book mark, but the only thing that’s transferring is the first field. I know couple of ppl went through the same trouble to achieve the same goal as me. And they asked the same question but their queries were un-answered, is it something that can not be done??? I am sure there has to be a way to do this; I am looking for some assistance here. That I will really appreciate.

I know I have a topic going on for a while now, about the same topic. But seem like there is no point of bringing that thread up over again, and it’s kind of dead.

View 14 Replies View Related

How To Match 4 Character Word Or Number Or Combination By Identical 4 Characters Word

Apr 11, 2013

How to match 4 character word or number or combination by identical 4 characters word or number or combination in one word have 10 or 15 characters.

I have to two separate tables (Table A and Table B). Table A has one column (Tag No) and Table B has about 15 columns with one column name Tag No as below

Table A

Table B

Tag No

Tag No

2009

ZZZ-2030-DC

2010

ZZZ-2010-M9P

[code]....

They're both in MS Access.I am trying to match 2 tables - columns (Tag No) with join query, but not success. I want to match 4 characters in Table-A with 4 similar characters in Table-B (Tag No) cell.What query is suitable to compare two tables.

View 8 Replies View Related

Word :: Sizing MS Word Table To Same Size As Recordset

Aug 14, 2014

My end goal is to populate a pre-existing table in an MS Word document with records from a query. The easiest way I've found (through scouring the internet) is to start with the code below (ran during OnClick() even in Access) to get the table the same size as the recordset:

Code:
Dim wDoc As Word.Document
Dim wTable As Word.Table
Dim wCell As Word.Cell
Set wDoc = appWord.Documents.Add(strDocLoc)
wDoc.Visible = True

[Code] ....

The code will shrink the table down just fine if the table has more rows than the recordset +1 (for header column). My hangup with this is the last line ("Selection.InsertRowsBelow 5") isn't executing; rows are not being added to the table. I get no errors -- it just does nothing. I set it as "Selection.InsertRowsBelow 5" arbitrarily just to see if it would even add rows, and sure enough it's not.

View 9 Replies View Related

Contents Of A Field Based On The Contents Of Another Field

Jul 14, 2006

Hi,
I'm making a form where the contents of a field is determined on the contents of another field in another form. I thought an IIF function would work, but when I tried it the contents says #NAME.

I put it in the control source.

IIF([Forms]![Frm_NewBusiness]![Page4]![Child51]="NTU",NewBusiness_Date_Issued="NTU",NewBusiness_Date_Issued)

Any ideas?

Cheers,
Ben

View 1 Replies View Related

Database Contents GONE!?!?

Jul 26, 2005

I go to open my Access 2000 database this morning and the contents: tables, queries, forms, reports, macros...all gone! The database file is still there, and when I go to view it's properties, I verified that it is the database that I created back in April and not somebody that overwrote my database using the same filename.

Is there any technical explanation as to how this could have happened? Or is it undoubtedly the result of human intervention?

I placed it on a network drive here at work.

I kept a copy thank god, but the copy is a couple weeks old and I'll lose alot of recent data. I've put in a request to have them restore the file from when it was last used Friday.

Just wondering what could have happened so I can prevent this from happening again.

Thanks!

View 4 Replies View Related

I Cant See A Table's Contents As It Is

Jan 21, 2007

sorry for the title. i didnt know what to write.
this is the situation:

i have a form where it populates a table in access (ssmdata) from an oracle table w_ssm_data). this works perfectly.

Then the form read the hole new table in access (ssmdata) to update a specific field.

Problem:
If i open the access table (ssmdata) it is sorted by the flight fields. However, when the form reads the table in order to update the specific field the table seems to not to be sorted by the flight field.

More info:
The ssmdata table in access has many primary keys (flight, departure,arrival,caterer,frequency and aircraft).

If i take a look to the W_ssm_data table in oracle it is not sorted by flight and it is sorted in the same way the form is reading the ssmdata table in access.

example:
table in access:
flight dep arr caterer aircraft frequency
1 a b a 111 67
1 a b a 222 134
2 c s c 111 5


table in oracle:
flight dep arr caterer aircraft frequency
2 c s c 111 5
1 a b a 111 67
65 t h t 252 1


when the update step starts it reads the access table as it looks in oracle. but if i open the table in access it looks sorted by flight.

thx 4 your hlp again, max

View 3 Replies View Related

Contents Of Combo Box

Mar 10, 2006

I have a new job at a company that had someone else develop their Access application. My boss has asked me to print out all of the options in several comboboxes so he can have me either add to or delete some of the items in the list.

Is there a way I can copy all of the items in the list of a combobox? :confused: These comboboxes are not bound to any tables.

I hope I have explained this well enough for everyone to understand what I am asking.

Thank you in advance for your help.

View 2 Replies View Related

Have I Just Lost All The Contents Of My Database?

Nov 14, 2006

Hello all,

I had just created a startup screen which I wanted my access database
application to open automatically in.

On the tools menu I selected the startup option and specified the file I
wanted to appear in the startup. I used a form for this but noticed that a
forward and backwards navigation box appeared on this form, which I didn't
want. As such I went back into the startup option and unselected all the
checkboxes (hoping that one of them might correspond to the navigation box - I didn't reallt read them). I then closed down the database and opend it up again.
However, now, upon starting I only get the startup form I specified, and when
I close it I can't see my other forms and tables anywhere? I want to undo my
actions but only File Window and Help are available in the menu bar above.
Arrggghhh!!!!. I've searched for them everywhere but they all seem gone? Seems like a disaster.

Any help on recovering my work would be greatly appreciated.

thanks

Adam

View 3 Replies View Related

Is It Possible To Enter The Contents Of The Parameter Value Box?

Jul 13, 2007

Does anyone know if it's possible to edit the contents of the "Enter Parameter Value" Box...for starters, I'd like to delete the phrase "Please Enter Parameter Value" as it means nothing to most users of Access; also, I'd like to format the text that I've entered in the query itself, i.e. make it bold, increase the size of it.

Incidentally, I did go down the route of linking my query to a form but this caused problems as I want more that one user to be able to view their particular parameter value at the same time.

Many thanks

View 13 Replies View Related

Linking Combo Box Contents

Jan 12, 2005

Hi.
I have created a database for an old office filing system in work.
There are 2 tables – Files & File Contents.
Table ‘Files’ has 5 fields: ID; Number (e.g. 1/03); Title; Status (e.g. Live/Closed – created a list on the relevant form using the Lookup wizard when creating the table) and Referenced To – at some point in the future all these files will be closed and this last field will show what all future correspondence is filed on.
Table ‘File Contents’ basically lists all correspondence on every file. But, some of the files have categories exclusive to them.
In the form ‘File Contents’ if someone was inputting new correspondence I would like the category lists to show just the relevant category for that file, i.e. if File 1/03 Training is selected then the 3 Training Categories will show and if File 5/03 is selected then the 2 categories relevant to it are shown.
But I don’t know how to do that…..
Should I create new tables for each of the ‘Files’ showing the categories or would one category table do?
I would be grateful of any help/advice you can give me.
Thanks.
Philip

View 1 Replies View Related

Copying Table Contents

May 18, 2005

Hi,
I am trying to copy the contents of a table with 11 fields into a new table which is the same except for an additional two fields at the end.
Any advice would be appreciated..
Thanks..

View 2 Replies View Related

Compare Contents Of Two Tables

Oct 5, 2007

I have two tables that have the exact same structure. They both started with the same data, but each were changed separately. (Two copies of the same DB, editted separately). I need to review the data in each record and determine what has changed or if records have been added. Is there an easy way for me to do this? (Note: Each record does have a primary key)

View 1 Replies View Related

Viewing Contents Of Two Tables

Aug 27, 2007

Greetings to All,

I have one table (tblLink) that resides on an SQL Server quite a distance from me. I have another table (tblLink_r) that resides in a local .mdb file. The tables are identical except for the data they contain and where they are located. Only one index (LinkIdx=autonumber) exists. I am making sure there are no duplicate indicies in the LinkIdx fields because I started the LinkIdx field in tblLink_r at 2100000000.

When I open tblLink (remote), I can scroll to the end of the 21,000 records relatively quickly - read: little latency. Queries performed on this table similarly show little latency.

When I open tblLink_r, I also have little latency. This table has 100 records.

I need a single object which contains the contents of tblLink and tblLink_r. I have tried a UNION ALL, but this query takes upwards of 4 minutes to complete which I can't understand since either of the constituent tables only take ~.5 seconds to call up.

I am hoping someone can provide a way to speed up the UNION ALL query or provide an alternate means to combine the contents of these tables.

View 2 Replies View Related

Locking The Contents Of A Combo Box?

Jan 30, 2006

I have a combo box whose row source comes from a table. I want ppl to be able to select from the combo box but I don't want them to be able to make any changes to its content (in the table).

How do I do that? I've fiddled around with the Lock features in the forms but I cannot get the right setting. Advice? thanks.

View 2 Replies View Related

Print List Box Contents.......

Mar 24, 2006

...seems such a simple thing to do but I'm completly stuck. Everything I've found on the forum suggests alternatives to doing to above i.e. setting the query that produces the list to produce that report print directly but that wont work for this situation unfortunately.:eek:

Some background....
I have a form (lucky me) in which the user enters 3 category levels and a branch id, they click a button to generate a list of 50 random stock ids so they can be checked at the branch. A preview of the Stockid's (along with description and Stocklevels) is shown in a list on the form. The stock manager then needs to print the list box contents. If the query is re-run it will differ from what is shown in the list so I need to avoid this.

Any help greatly appreciated.....;) :confused: ;)

View 2 Replies View Related

Refresh Combo Box Contents

Aug 3, 2006

I have a combo box on a form to enable users to find records. When the form opens initially, these boxes are blank. However, after a search has been performed, the selected information in the combo box stays there, as well as the record opening up. How can I make the combo box revert to being blank after the record has opened on the form?

Thanks in advance,

Gary

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved