G
Guest
Hey,
i have a tab control that contains numerous test boxes that i would like to
enumerate over them, to build up an sql search string. i.e
Dim ctl As Control
Dim AddAnd As String
AddAnd = ""
strSQL = ""
' Enumerate Controls collection.
For Each ctl In Form.Controls
' Check to see if control is text box or combo box
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If Not IsNull(ctl.Value) Then
strSQL = strSQL & AddAnd & " " & ctl.Name & " = " & ctl.Value
AddAnd = " And"
End If
End If
Next ctl
this code works fine to build up the SQL string, but for one problem. i have
a tab control that shows data from many different tables, each with their own
text boxes for a search, and the code above enumerates over ALL of the text
boxes, not just the ones that are visible in the current page of the tab
control.
how can i enumerate over only the text boxes in the current page of the tab
control?
i have a tab control that contains numerous test boxes that i would like to
enumerate over them, to build up an sql search string. i.e
Dim ctl As Control
Dim AddAnd As String
AddAnd = ""
strSQL = ""
' Enumerate Controls collection.
For Each ctl In Form.Controls
' Check to see if control is text box or combo box
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If Not IsNull(ctl.Value) Then
strSQL = strSQL & AddAnd & " " & ctl.Name & " = " & ctl.Value
AddAnd = " And"
End If
End If
Next ctl
this code works fine to build up the SQL string, but for one problem. i have
a tab control that shows data from many different tables, each with their own
text boxes for a search, and the code above enumerates over ALL of the text
boxes, not just the ones that are visible in the current page of the tab
control.
how can i enumerate over only the text boxes in the current page of the tab
control?