From: Daryl S on
TAZ1NOLES -

I think it is because of the colon after the Else in your code (both
places). Access is probably treating the Else: as a label, which is ignored
in sequential processing. You could tell this be stepping through the code
while it is running. Anyway, try setting the Else on its own line without
the colon, like this:

Private Sub CABLE_TAGS_PRESENT_AfterUpdate()
If Me.[CABLE_TAGS_PRESENT] = "No" Then
Me.[CABLE_TAGS_READABLE].Visible = False
Else
Me.[CABLE_TAGS_READABLE].Visible = True
End If


--
Daryl S


"TAZ1NOLES" wrote:

> I have tried the following 2 sets of Event Procedures to hide fields on a
> form when the data in another control = NO but no matter what I do the fields
> still appear on the form & the print preview. Any thoughts or assistance
> would be greatly appreciated!
>
> ***********************************************************
>
> Private Sub CABLE_TAGS_PRESENT_AfterUpdate()
> If Me.[CABLE_TAGS_PRESENT] = "No" Then
> Me.[CABLE_TAGS_READABLE].Visible = False
> Else: Me.[CABLE_TAGS_READABLE].Visible = True
> End If
>
> End Sub
>
> ***********************************************************
>
> Private Sub PRIMARY_CABLE_REPLACEMENT_AfterUpdate()
> If Me.[PRIMARY CABLE REPLACEMENT] = "No" Then
> Me.[PRIMARY CABLE COMMENTS].Visible = False
> Me.[CABLE_FEEDER__1].Visible = False
> Me.[CABLE_FEEDER__2].Visible = False
> Me.[CABLE_FEEDER__3].Visible = False
> Me.[CABLE_FEEDER__4].Visible = False
> Else: Me.[PRIMARY CABLE COMMENTS].Visible = True
> Me.[CABLE_FEEDER__1].Visible = True
> Me.[CABLE_FEEDER__2].Visible = True
> Me.[CABLE_FEEDER__3].Visible = True
> Me.[CABLE_FEEDER__4].Visible = True
> End If
>
> End Sub
> --
> PAT FEARNS
First  |  Prev  | 
Pages: 1 2
Prev: Show Button
Next: After Update If