G
Guest
I have a function that needs to be called many places so I want to setup a
function so I can pass the form name and control name to the function to do
some stuff. The calling form has
set_statusbartext Me.Form, Form.ActiveControl.Name
I'm trying to pass the form name and the control name to the following
function
Public Function set_statusbartext(frm As Form, ctl As Control)
Dim temp_ctr As Integer
frm.ctl.StatusBarText = ""
If frm.ctl.ListCount > 0 Then
If frm.ctl.ListCount < 15 Then
Do Until temp_ctr > frm.ctl.ListCount - 1
frm.ctl.StatusBarText = frm.ctl.StatusBarText & " [" &
frm.ctl.ItemData(temp_ctr) & "] "
temp_ctr = temp_ctr + 1
Loop
Else
frm.ctl.StatusBarText = "too many to display!"
End If
End If
End Function
the set_statusbartext function is passing the form name but the value of the
control, not the control name...what am I missing? thanks!
function so I can pass the form name and control name to the function to do
some stuff. The calling form has
set_statusbartext Me.Form, Form.ActiveControl.Name
I'm trying to pass the form name and the control name to the following
function
Public Function set_statusbartext(frm As Form, ctl As Control)
Dim temp_ctr As Integer
frm.ctl.StatusBarText = ""
If frm.ctl.ListCount > 0 Then
If frm.ctl.ListCount < 15 Then
Do Until temp_ctr > frm.ctl.ListCount - 1
frm.ctl.StatusBarText = frm.ctl.StatusBarText & " [" &
frm.ctl.ItemData(temp_ctr) & "] "
temp_ctr = temp_ctr + 1
Loop
Else
frm.ctl.StatusBarText = "too many to display!"
End If
End If
End Function
the set_statusbartext function is passing the form name but the value of the
control, not the control name...what am I missing? thanks!