|
-
Mar 18th, 2004, 08:55 AM
#1
Thread Starter
Hyperactive Member
Mail merge (yuck)[resolved]
Hi guys
Wasn't really sure where to put this one and not even a coding issue, just thought someone here may know:
If I do a mail merge, getting the data from an access query, how can I display a value of 'False' from a yes/no field as a different character on the word document? I need to display, say, an 'X' where the value in the table is 'False' and nothing if the value is 'True'.
Any ideas?!
Cheers
Last edited by thebloke; Mar 19th, 2004 at 05:33 AM.
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Mar 19th, 2004, 04:57 AM
#2
Thread Starter
Hyperactive Member
No? Ok, how about this:
I put an activeX checkbox on the word document which I want ot wire up to a corresponding field in my mailmerge (the datasource of which is an Access 97 query). How do I do this?!
Cheers
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Mar 19th, 2004, 05:33 AM
#3
Thread Starter
Hyperactive Member
Never mind. I've solved it. By inserting a Word Field with an If...Then...Else statement to convert the value of the field inserted by the merge from False to 'X'.
Incidentally, I was also getting a daft error:
VB Code:
"Run-time error '2486';"
("You can't carry out this action at the present time.")
which, from doing a bit of digging, it seems a lot of people get but I haven't found an answer to.
I got the error while trying to use docmd in vb6 to run a macro in a word 2002 document which carried out the mail merge and sent it to a printer. In the end, I abandoned this and used the following code:
VB Code:
public function mailmerge(valIn)
dim strcode as string
dim objword as word.document
set objword = getobject("C:\pathwheredocis\" & strcode & ".doc")
objword.application.visible = true
objword.mailmerge.viewmailmergefieldcodes = wdToggle
with objword.mailmerge
.destination = wdsendtoprinter
.suppressblanklines = true
with .datasource
.firstrecord = wddefaultfirstrecord
.lastrecord = wddefaultlastrecord
end with
.execute pause:=false
end with
objword.close
set objword = nothing
end function
I hope this information is useful to someone!
Cheers
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|