Click to See Complete Forum and Search --> : How do I go about calling a module
Noel Scully
Jan 21st, 2000, 03:07 AM
I find the VB Help very Cumbersome and difficult to use and understand - it seems to talk in Martian at least not in a way that someone new to VB can easily interperet
Reading books is all very well if you have the time and concentration of monks
Anyway I think I can get my head around the notion of code reuse but how does this migrate to my form
netSurfer
Jan 21st, 2000, 03:13 AM
If I understand what you asking, basically, sing modules( ie functions) allows you to put often used chunks of code into functions. Then, instead of retyping this code over and over, you just call the function. Also, it allows you to seperate your code into logical parts. It makes it easier to maintain and to read. Hope this makes it a little more clear.
JohnAtWork
Jan 21st, 2000, 03:22 AM
In a nutshell:
Public Sub YourSub()
'Code goes here
End Sub
Now when you want to use this in a form later, (say attached to a command button that you've changed the forecolor on ;P)
you would have the following:
Private Sub cmdButton_Click()
Call YourSub
End Sub
[This message has been edited by JohnAtWork (edited 01-21-2000).]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.