By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,479 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,479 IT Pros & Developers. It's quick & easy.

Populate word Userform from Access

P: n/a
Hi, I am working with a template document that has previously been
created. I want to be able to populate the fields on the Userform on
opening the Word template but before the form is shown. I also want to
loop through all the controls on the form and get the control name. I
have successfully opened the existing template and disabled autonew().
then activated Form1. However, that where I hit a brick wall. I want
to avoid coding in word, rather I would like to push the data from
access. Can anyone help?

Mar 3 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The easiest way to crack this sort of problem isto do the work in Word and
then transfer the code to Access and amend as appropriate.

--

Terry Kreft
"Kera" <ke*****@hotmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
Hi, I am working with a template document that has previously been
created. I want to be able to populate the fields on the Userform on
opening the Word template but before the form is shown. I also want to
loop through all the controls on the form and get the control name. I
have successfully opened the existing template and disabled autonew().
then activated Form1. However, that where I hit a brick wall. I want
to avoid coding in word, rather I would like to push the data from
access. Can anyone help?

Mar 3 '06 #2

P: n/a

Terry Kreft wrote:
The easiest way to crack this sort of problem isto do the work in Word and
then transfer the code to Access and amend as appropriate.

--

Terry Kreft
"Kera" <ke*****@hotmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
Hi, I am working with a template document that has previously been
created. I want to be able to populate the fields on the Userform on
opening the Word template but before the form is shown. I also want to
loop through all the controls on the form and get the control name. I
have successfully opened the existing template and disabled autonew().
then activated Form1. However, that where I hit a brick wall. I want
to avoid coding in word, rather I would like to push the data from
access. Can anyone help?


Mar 3 '06 #3

P: n/a
Thanks Terry

I did do the work in Word. This is the part of the code that doesn't
seem to work in Access, works fine in word (using debug.print to check)

Dim ctrl as control
For each ctrl in frm.controls
'Do whatever
debug.print ctrl.name
next

This is not returning the control name in the active form.
Thanks in advance.

Mar 3 '06 #4

P: n/a
Are you sure you've identified the frm object?
If this is running from the form then can't you just use

Dim ctrl as control
For each ctrl in Me.controls
'Do whatever
debug.print ctrl.name
next

Should work in Word and Access.
--
"Kera" <ke*****@hotmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Thanks Terry

I did do the work in Word. This is the part of the code that doesn't
seem to work in Access, works fine in word (using debug.print to check)

Dim ctrl as control
For each ctrl in frm.controls
'Do whatever
debug.print ctrl.name
next

This is not returning the control name in the active form.
Thanks in advance.

Mar 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.