D
Dan Nawrocki
I'm sure there is a simple solution to this, but I can't find it 
I have a form with a list box and a button in it. When I hit the button, I
would like to add some text to the list box ("asdf" suffices for now).
However, I would like to add the text from another subroutine, not directly
from the button_click subroutine. My problem is that when I pass the list
box control to the subroutine, it ALWAYS is null. How can I fix this?
Sample code:
Private Sub button_Click()
subroutine (listBoxControl)
End Sub
Private Sub subroutine (lb as ListBox)
lb.AddItem ("asdf")
End Sub
I always get a 424 error on the line "subroutine (listBoxControl)".
However, the following code works as expected:
Private Sub button_Click()
listBoxControl.AddItem ("asdf")
End Sub
I've tried every combination I could think of using the full form name, the
"Me" variable, dots and bangs, but everything I have tried will pass null to
the function.
Thanks,
dan
I have a form with a list box and a button in it. When I hit the button, I
would like to add some text to the list box ("asdf" suffices for now).
However, I would like to add the text from another subroutine, not directly
from the button_click subroutine. My problem is that when I pass the list
box control to the subroutine, it ALWAYS is null. How can I fix this?
Sample code:
Private Sub button_Click()
subroutine (listBoxControl)
End Sub
Private Sub subroutine (lb as ListBox)
lb.AddItem ("asdf")
End Sub
I always get a 424 error on the line "subroutine (listBoxControl)".
However, the following code works as expected:
Private Sub button_Click()
listBoxControl.AddItem ("asdf")
End Sub
I've tried every combination I could think of using the full form name, the
"Me" variable, dots and bangs, but everything I have tried will pass null to
the function.
Thanks,
dan