There is a form bound to a crosstab table which will eventually contain 60 fields. It currently contains around 10 the other 50 fields are bound to the control sources that will exist in the future but not at the moment (still with me)
They currently display #Name. I want to hide them so only the text boxes with a valid value are displayed
the only thing that I can think of is to trap the error when you try to read the value. try this code in the Current event of the form. it will probably be possible to add a loop so you dont have to name all 50 fields individualy
Code:
Dim xxx As Variable
Dim bolShow As Boolean
bolShow = True
On Error GoTo errorTrap
xxx = Me.Text20
Me.Text20.Visible = bolShow
bolShow = True
Exit Sub
errorTrap:
If Err.number = 2424 Then
bolShow = False
Resume Next
End If
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.