ClaraBarton
Registered User.
- Local time
- Today, 12:11
- Joined
- Oct 14, 2019
- Messages
- 800
I have a form that has 2 listboxes. Only 1 visible at a time. Since both share many routines I need to know which one is visible.
Hence a little public routing that checks it.
My problem is... I never know how to address controls on a form
Is a form in this situation a form? or is it a string?
So in a routine I want to say:
is lst a listbox?
or is it a string?
Basic VBA that I should know but never do!
Hence a little public routing that checks it.
Code:
Public Function VisibleList(frm As Form)
Dim ListView As ListBox
If frm.lstName.Visible = True Then
Set ListView = frm.lstName
Else: Set ListView = frm.lstTrans
End If
End Function
Is a form in this situation a form? or is it a string?
So in a routine I want to say:
Code:
dim lst as Listbox
Set lst = ListView me.Name
lst.requery
or is it a string?
Basic VBA that I should know but never do!