We help IT Professionals succeed at work.

Does my program has to consist of just one file?

n96radsb
n96radsb asked
on
170 Views
Last Modified: 2010-05-02
I have written a fairly long program (more than 3000 lines of code) and the code is located in one form(?!) is it possible to write functions and subs in another file, and then call those from the first form.
The reason is that it would be nice to divide the code to get a better overview, and dont have to have finished functions at same place as unfinished functions?
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Okay, that worked, so I moved a sub to a new module. but now I cant write to text fields from the sub in the new module. it just says sub or function not defined when I try write in a text field. what shall I do?

Commented:
prefix text field name with form name, something like this

mainForm.txtName.text= "Name "

mainForm-> nbame of the form
txtname->name of the field

Author

Commented:
it worked excellent!
thanks.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.