473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Populate word Userform from Access

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
4 2559
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephen Witter | last post by:
I have textboxes in a word docment that I would like to populate via an asp.net page. Is this possible? The reason I ask is right now I am using a macro in word and I don't want to have to use...
5
by: Daniel Walzenbach | last post by:
Hi, I need to know how I could populate a word file from within ASP.NET and stream it out to some user (I can rely on all users have at least Word XP installed). The preferable solution would be...
0
by: szymon_k | last post by:
Hi. How to set the userform as subform of some access form? What I need to do is to insert some userform into the form, so that it will be under the same conditions of resize, move and other...
3
by: gw.boswell | last post by:
I have created a userform with textboxes for data entry. I also have a command button that calls a second useform. A user enters certain information in the first useform but if he/she wants to do...
2
by: williamyeow | last post by:
Hi i am new to excel VB. can anyone tell me how to link userform to another userform? My concept for my program I have set up a userform with a couple of option. after the user has chose the...
2
by: golf32902 | last post by:
i have a button on sheet 1 and i would like the userform to insert the text i input into sheet 2. And if there is a way the next time i access the userform that is inserts wha i have in the cell...
1
by: JustDucky | last post by:
Hi! I have a word template that utilizes a userform to gather information from the user and place it into specific Doc Variable locations within the form. If the user reopens the userform and...
3
pod
by: pod | last post by:
Hello What I want to do is: from this workbook (thisWB), I want to access a userform's properties that are in another Workbook (toolWB) I can do this for worksheets, but I want to do it as...
5
by: jazznojive | last post by:
I've created a textbox control on a userform and I am trying to figure out how to make the text populate to a worksheet range in sequence automatically. I've figued out how to get the text that the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.