Passing form fields between subroutines

-ian-

Registered User.
Local time
Today, 04:23
Joined
Apr 12, 2002
Messages
32
Hi all,

I'm trying to streamline what I can see as being repetitive code in a form.

To get rid of the code repetition, I will need to pass textboxes as arguments between subroutines.

So my problem is now this: How do I declare a textbox when I pass it between subroutines?
 
It's not at all difficult, but it doesn't work quite as you're describing it. You don't pass the textboxes, but you pass the data contained in the textboxes to subroutines.

Look up "Passing Arguements" in the Access Help, and there's a rich abundance of info about how to do it.

-Curt
 
Thanks for the reply!

This might be another case of doing things arse-about-face (I am a very new to this stuff), but the reason why I need to pass the textboxes themselves (and not the contents) is because I need to do operations on the textboxes.

In summary: I have 10 sets of textbox pairs on the form. The pair consists of a textbox which accepts an ID code, and its bound partner which returns the a description for the code.
For the ID code textbox I have BeforeUpdate code which contains requeries and undo's for the textboxes. I currently have to replicate this code a further 9 times making small alterations in each one like changin Me.ID1.undo to Me.ID2.undo & Me.text23 to Me.text24.

Am I tackling this right?
 

Users who are viewing this thread

Back
Top Bottom