PDA

View Full Version : link text boxes



runningpiema
11-29-2012, 01:07 AM
Hi There,
I have managed to link an excel doc to a combobox in Word. Now i need to populate about 8 text boxes from the selection made by the user in the combobox.
Help Please.
Thanks,
Gordon

macropod
11-29-2012, 03:28 AM
Where and what kinds of textboxes are these?

runningpiema
11-29-2012, 03:51 AM
see the attached, i select from the combobox drop down then the rest need to be populated from fields in teh excel doc linked to the combobox

macropod
11-29-2012, 04:02 AM
Presumably, your combobox contents can be related to particular Excel addresses and the data you want for the textboxes can be identified via offsets from there. Without access to either the Excel workbook or your form and its code, it's impossible to give specific advice as to what additional code you would need.

runningpiema
11-29-2012, 02:50 PM
see attached excel workbook

macropod
11-29-2012, 04:55 PM
How about the form & code? As I said:

Without access to either the Excel workbook or your form and its code, it's impossible to give specific advice as to what additional code you would need.
Without even opening your workbook, it's obvious you haven't inlcuded the form & code.

fumei
11-29-2012, 09:43 PM
Is this an Excel or Word question? It is an Excel file.

runningpiema, you need to give full information if you want to get help or suggestions. Be specific, and give an workable example.

runningpiema
12-03-2012, 08:30 PM
sorry was just away for a couple of days sick. what is the best way to show you the form and code?

macropod
12-03-2012, 09:34 PM
what is the best way to show you the form and codeBy attaching the document containing them to a post, just like you did with the Excel workbook.

runningpiema
12-17-2012, 12:45 PM
sorry for the delay have been away deaing with family issues. See attached the doc i am using and the macro and code behind it.

Thanks so much for your help so far.

macropod
12-21-2012, 06:23 PM
See attached.

I've substantially re-worked the 'UserForm_Initialize' sub, added a 'SPNumber_Change' sub to show how to populate the dependent textboxes and cleaned up your 'CommandButton4_Click' sub.

I also get the impression that your 'CommandButton4_Click' sub is trying to update multiple tags in the document with the same value, but you've given those tags different names. This is unnecessary - you can give all tags that are to hold the same information the same name, and let the Find/Replace action update the data for all related tags in one go rather than iteratively.