I am using MS Access 2016 and building a form to run a query that enables users to only extract columns that they need. I am planning on doing this with a checkbox for every column. How can I do this? I have tried the following but it does not work. It gives me a Compile Error: Method or data member not found.
Private Sub chk1_AfterUpdate()
Me.column4.Visible = Nz(Me.chk1 = True, False)
End Sub
Private Sub Form_Current()
Me.column4.Visible = Nz(Me.chk1 = True, False)
End Sub
CodePudding user response:
You can hide a control but not a field. So try, where TextBox4 is bound to your column4:
Private Sub chk1_AfterUpdate()
Me!TextBox4.Visible = Nz(Me!chk1.Value, False)
End Sub
Private Sub Form_Current()
Me!TextBox4.Visible = Nz(Me!chk1.Value, False)
End Sub
CodePudding user response:
Private Sub Check20_Click()
If Me.Check20.Value = -1 Then
Me.ID.Visible = False
Else
Me.ID.Visible = True
End If
End Sub