Controls Name value not typename query

  • Thread starter Thread starter Rob W
  • Start date Start date
R

Rob W

Greetings

I have the code below where I would like ALL but ONE of fields to have the
text set to BLANK and made visible.

How can I add a statement to only set X.Text and X.visible values if it isnt
ME.combopatient??

I've look at the functions under controls and can see how I can directly
access the control name.


For Each X In Me.Controls

If TypeName(X) = "TextBox" Or TypeName(X) = "ComboBox" Then

'If not comboPatient then do the following ...
X.Text = ""
X.Visible = False
Else
comboPatient.Enabled = True
End If

ElseIf TypeName(X) = "Label" Then
lblDateRegistered.Caption = ""
End If
Next


Thanks
Rob W
 
Back
Top