Changing the message in a text box...

Brandon

New member
Local time
Today, 20:30
Joined
Jun 21, 2001
Messages
7
Hello!

I would like to know how to set up a macro or a query so that when I click a button on a form, I get a message to appear in a text box related to that button. I have done this successfully using individual macros for each button and a simple SetValue command, but I would like to do it with a single macro and store all the text messages in a table, making things a lot faster and cleaner than having 50 macros for all the buttons.

I guess what I need to know exactly is how to link a button click with the text message in the table, and then display it in my text box.
 
You should create a function that takes in one arguement("intTextNumber"). Set up a table with unique numbers and the messages to go along with them. In the Click event of each message box, call the function and use the unique number to get the text for the message box. You can use a Dlookup or a SQL statement to compare the passed number and the stored number in your table. Hope this helps.

Doug
 
Great, thanks!!

I'll give it a try and let you know how it goes!

-Brando
 

Users who are viewing this thread

Back
Top Bottom