Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-08-2004, 07:09 AM   #1
Mike375
Guest
 
Posts: n/a
Running code that is OnClick on labels

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

  Reply With Quote
Old 06-19-2004, 05:38 AM   #2
Pauldohert
Something in here
 
Join Date: Apr 2004
Posts: 2,101
Thanks: 0
Thanked 5 Times in 5 Posts
Pauldohert is on a distinguished road
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.
Pauldohert is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 07:52 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World