Code:
Function Ctrl_msgbox(control as string) msgbox [form_1].control end function sub test call ctrl_msgbox(tbx_information)¨ end sub
Public Function Ctrl_msgbox(control As String)
Ctrl_msgbox = Forms!form_1!(control)
End Function
Sub test()
Me.MyControl = Ctrl_msgbox(tbx_information.Name)
End Sub
Public Sub Ctrl_msgbox(control As String)
msgbox Forms!form_1!(control)
End Function
Sub test()
Call Ctrl_msgbox(tbx_information.Name)
End Sub
Public Function fQueryControl(ctlControl As Control)
Select Case ctlControl.ControlType
Case acCommandButton
Debug.Print ctlControl.Name & " is a Command Button"
Case acTextBox
Debug.Print ctlControl.Name & " is a Text Box"
Case acComboBox
Debug.Print ctlControl.Name & " is a Combo Box"
Case acCheckBox
Debug.Print ctlControl.Name & " is a Check Box"
Case acImage
Debug.Print ctlControl.Name & " is an Image Control"
Case acLabel
Debug.Print ctlControl.Name & " is a Image Control"
Case acListBox
Debug.Print ctlControl.Name & " is a List Box"
Case Else
Debug.Print "Don't really care!"
End Select
Dim ctl As Control For Each ctl In Me.Controls Call fQueryControl(ctl) Next
Command7 is a Command Button Command8 is a Command Button txtSelectedFile is a Text Box Label10 is a Image Control ShippedDate is a Text Box Label16 is a Image Control cboTest is a Combo Box Label15 is a Image Control Command17 is a Command Button Command18 is a Command Button imgTest is an Image Control chkImage is a Check Box Label21 is a Image Control Command22 is a Command Button Text25 is a Text Box Don't really care! Don't really care! Label29 is a Image Control
Comment