Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing form control value for Word merge

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
US
I´m doing a merge file in Word that accesses the data in MS Access 2000. Priorly in Office 97, the previous programmer used this line to capture the data in an open form´s control but it doesn´t seem to work in 2000.

strProdNum = acApp.Screen.ActiveControl.Value

It gives the message that the control doesn´t have focus. The line is in a Merge document. I´m trying to pull just the records related to the data in the one control. I created an input box to have user manually put it in and it works. But I´d rather have the data get captured on the Access 2000 form.

Any ideas what I need to do?

Thanks!

Mary :eek:)
[sig][/sig]
 
Try replacing this

strProdNum = acApp.Screen.ActiveControl.Value

with

acApp.Screen.(Name of the control to get data from).SetFocus
strProdNum = acApp.Screen.ActiveControl.Value

That should put the focus on the correct control. Then the second line should work.
Just a guess, access is one of my weak points. I think it will work. [sig]<p>Ruairi<br><a href=mailto:ruairi@logsoftware.com>ruairi@logsoftware.com</a><br>Experienced with: <br>
VB6, SQL Server, QBASIC, C(unix), MS Office VBA solutions<br>
ALSO: Machine Control/Automation using GE and Omron PLC's and HMI(human machine interface) for industrial applications[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top