C
Colin Foster
Hi Group.
Using Office XP
I've been trying to resolve an issue for a while now, which I've left alone
for a few weeks in the hope that inspiration will strike! As it hasn't, I've
come back here!!
I have a database which sends data to a word document by making use of the
bookmark features of Word.
Part of the current code that is attached to a button within my form is as
follows...
.ActiveDocument.Bookmarks("Architect").Select
.Selection.Text = (CStr(Me.CustName))
.ActiveDocument.Bookmarks("MainContractor").Select
.Selection.Text = (CStr(Me.CustName))
In my tables, I have the following set up...
CustName Type
John Doe Architect
Jane Doe MainContractor
In my Word Document there are 2 bookmarks, one named Architect, the other
MainContractor. The data to be put in here is the CustName field.
However... by using the code shown above, then both bookmarks are completed
with the details from the record that I'm looking at within the form (i.e.
if I'm looking at "John Doe", then he shows as both Architect and Main
Contractor. What I need is that when I click the button, for "John Doe's"
details to appear in the Word Bookmark as the "Architect" & "Jane Doe" as
the MainContractor.
In a previous discussion on this issue, Chris Nebinger suggested the
following code...
..ActiveDocument.Bookmarks(Me.Controls("Type")).Text = CStr(me.CustName)
If I use this, then if my form is showing the details for "John Doe", then
only the "Architect" bookmark is completed, if I'm looking at "Jane Doe"
when I click the button, then only the "MainContractor" bookmark is
completed.
I've tried to make a "For...Next" and "If...Else" statement work, but with
exceptional lack of success! Hence the return to this Group.
Any suggestions will be gratefully taken!!
Regards
Colin Foster
Using Office XP
I've been trying to resolve an issue for a while now, which I've left alone
for a few weeks in the hope that inspiration will strike! As it hasn't, I've
come back here!!
I have a database which sends data to a word document by making use of the
bookmark features of Word.
Part of the current code that is attached to a button within my form is as
follows...
.ActiveDocument.Bookmarks("Architect").Select
.Selection.Text = (CStr(Me.CustName))
.ActiveDocument.Bookmarks("MainContractor").Select
.Selection.Text = (CStr(Me.CustName))
In my tables, I have the following set up...
CustName Type
John Doe Architect
Jane Doe MainContractor
In my Word Document there are 2 bookmarks, one named Architect, the other
MainContractor. The data to be put in here is the CustName field.
However... by using the code shown above, then both bookmarks are completed
with the details from the record that I'm looking at within the form (i.e.
if I'm looking at "John Doe", then he shows as both Architect and Main
Contractor. What I need is that when I click the button, for "John Doe's"
details to appear in the Word Bookmark as the "Architect" & "Jane Doe" as
the MainContractor.
In a previous discussion on this issue, Chris Nebinger suggested the
following code...
..ActiveDocument.Bookmarks(Me.Controls("Type")).Text = CStr(me.CustName)
If I use this, then if my form is showing the details for "John Doe", then
only the "Architect" bookmark is completed, if I'm looking at "Jane Doe"
when I click the button, then only the "MainContractor" bookmark is
completed.
I've tried to make a "For...Next" and "If...Else" statement work, but with
exceptional lack of success! Hence the return to this Group.
Any suggestions will be gratefully taken!!
Regards
Colin Foster