I have found this piece of code by searching the forum. On putting it in my data base and doing all the right things I get a message when I compile stating that Access wants a procedure not a module and highlights the line of code "Call HideIt("YourFormNameHere")"
Below is a copy of the code etc that i got from the forum, written by Jack Cowley (the wonderful!)
Set the tag property of the fields visibility you want to change to HideIt.
Create a module and add this code:
Function HideIt(FormName As String)
' This procedure will reverse the visability of any
' controls identified with Tag = "HideIt"
Dim F As Form, x As Integer
Set F = Forms(FormName)
For x = 0 To F.Count - 1
If F(x).Tag = "HideIt" Then
F(x).Visible = Not F(x).Visible
End If
Next x
End Function
In the On Current event of the form put code like this:
If Me.YourField = True Or Whatever Then
Call HideIt("YourFormNameHere")
End If
Place the above code in the After Update event of the field that determines if the fields should be visible or not.
Insert the correct name of your form and the correct name of your control that determines if the fields are visible or not.
[This message has been edited by Jack Cowley (edited 12-14-2001).]
Thanks for all responses, I hope I've put in enough information.
Rachael
Below is a copy of the code etc that i got from the forum, written by Jack Cowley (the wonderful!)
Set the tag property of the fields visibility you want to change to HideIt.
Create a module and add this code:
Function HideIt(FormName As String)
' This procedure will reverse the visability of any
' controls identified with Tag = "HideIt"
Dim F As Form, x As Integer
Set F = Forms(FormName)
For x = 0 To F.Count - 1
If F(x).Tag = "HideIt" Then
F(x).Visible = Not F(x).Visible
End If
Next x
End Function
In the On Current event of the form put code like this:
If Me.YourField = True Or Whatever Then
Call HideIt("YourFormNameHere")
End If
Place the above code in the After Update event of the field that determines if the fields should be visible or not.
Insert the correct name of your form and the correct name of your control that determines if the fields are visible or not.
[This message has been edited by Jack Cowley (edited 12-14-2001).]
Thanks for all responses, I hope I've put in enough information.
Rachael