In an attempt to clean up my code, I have tried to put all my functions and subroutines in a module. One of these subroutines populated a grid of RichTextBoxes with data from a MS Access database. It worked when the subroutine was in the form that it was being used on, but not in my Module. Is there any specific reason for this? I noticed while trying to use a RichTextBox in the code it said I needed to define it, so I went ahead and added this to the top of my Module:
Dim mon1 As New RichTextBox
Dim mon2 As New RichTextBox
Dim mon3 As New RichTextBox
Dim mon4 As New RichTextBox
Dim mon5 As New RichTextBox
It didn't actually put any text into the RichTextBoxes on my form and the subroutine did not throw back an error. I tried changing it from Dim
to Public
and it does the same thing.
Can anyone shed some light on this? Thanks.