Running code that is OnClick on labels (1 Viewer)

M

Mike375

Guest
I have four labels on a form that have code on the OnClick. This code in each case opens Word and inserts field data into BookMarks and each Word doc is linked to two queries. The code then then copies the Word doc and pastes it back to a memo field in Access and prints the Word doc and closes Word without saving. I am using Access 95.

If each of these four labels ran macro actions instead of code then I could make a macro that would run those 4 macros one after the other. Is there anything I can do to make each of the four codes run one after the after. Perhaps some sort of code in one of them to run the other three.

By the way my knowldge on code is quite limited. This data base has about 3000 macros and 2000 queries and only a few labels containing code to open Word so you get the idea

Thanks for any help

Mike
 

Pauldohert

Something in here
Local time
Today, 04:02
Joined
Apr 6, 2004
Messages
2,101
I am guessing this has since been solved but -

Very crude

put

label2_click
label3_click
Label4_click

at the end of the code in the label1 click event

Obviously this would only run if label1 was clicked - so better to put a line in each click event (instead of what is there already) which calls a separate routine and processes all four labels.(so clicking any label would run the process for all 4)

Further - if the code for each label is very similar, the code may need to be there only once and arguments would handle the 4 cases. (if this is not as you have it already), and a change in the way it worked would only need to be coded once and not 4 times.

Maybe you could post the code and someone can look at it.
 

Users who are viewing this thread

Top Bottom