Apply One Event Procedure to Multiple Textboxes

sig331

New member
Local time
Today, 14:28
Joined
Jan 19, 2012
Messages
7
Hi everyone. Long time reader, first time poster. I have searched and searched for an answer to this question with no avail. So I thought I would ask.

What I have is a form with 21 sets of textboxes, each set represents an item. The goal is to have the item information populate in the other textboxes of that set after the item number has been updated. The boxes are named as follows txt_ItemNum_#, txt_Description_# where # is a number from 1 to 21 that identifies the set.

I can write the procedure and all, but I'm hoping there is a more efficient way than creating 21 seperate events.

Thanks.
 
You could create a form-level function that accepted the number (1-21) as an input and did your work:

Me("txt_ItemNum_" & InputVariable) = Whatever

Then call it from each event property

=FunctionName(1)
 
You could create a form-level function that accepted the number (1-21) as an input and did your work:

Me("txt_ItemNum_" & InputVariable) = Whatever

Then call it from each event property

=FunctionName(1)

Thanks, I like this approach. All the code is in one spot and easy to manage. Works great.
 

Users who are viewing this thread

Back
Top Bottom