On the after update function, I have a few statements to show/hide fields based on what the user selects as the document number. When I toggle between the document numbers 12, 12SK, 13, 13SK, 14 and 14SK I can go back and forth and it works great, but the last two in the function (10 & 16B), the visible fields do not turn off, all the fields under this function still show. I added in "If Me.[Document No] <> "10" & "*" Then" after the else statement under the settings and that worked for that one, but even with that under the code for 16B, it still doesn't turn off. Interestingly, which ever statement I have at the end of this function is the one that doesn't work. eg if I move the document no 12 to the end, then the visibility for fields showing for document 12 won't turn off. Another thing is that if I select any other docuement number that I don't have in this code, all the visible fields, including 10 & 16B do turn off. Your help is greatly appreciated!
Here is the code:
Private Sub DocumentNo_AfterUpdate()
If Me.[Document No] Like "13SK" & "*" Then
Me.AffiliateCompany_Label.Visible = True
Me.Affiliate_Company.Visible = True
Me.Registration_Label.Visible = True
Me.Registration_Type.Visible = True
Me.LTO_Label.Visible = True
Me.LTO.Visible = True
Me.LTO = "SK"
Else
Me.AffiliateCompany_Label.Visible = False
Me.Affiliate_Company.Visible = False
Me.Registration_Label.Visible = False
Me.Registration_Type.Visible = False
Me.LTO = "N/A"
Me.LTO_Label.Visible = False
Me.LTO.Visible = False
If Me.[Document No] Like "13" & "*" Then
Me.AffiliateCompany_Label.Visible = True
Me.Affiliate_Company.Visible = True
Me.Registration_Label.Visible = True
Me.Registration_Type.Visible = True
Me.LTO_Label.Visible = True
Me.LTO.Visible = True
Else
Me.AffiliateCompany_Label.Visible = False
Me.Affiliate_Company.Visible = False
Me.Registration_Label.Visible = False
Me.Registration_Type.Visible = False
Me.LTO_Label.Visible = False
Me.LTO.Visible = False
If Me.[Document No] Like "12SK" & "*" Or Me.[Document No] Like "14SK" & "*" Then
Me.Registration_Label.Visible = True
Me.Registration_Type.Visible = True
Me.LTO_Label.Visible = True
Me.LTO.Visible = True
Me.LTO = "SK"
Else
Me.Registration_Label.Visible = False
Me.Registration_Type.Visible = False
Me.LTO_Label.Visible = False
Me.LTO = "N/A"
Me.LTO.Visible = False
If Me.[Document No] Like "12" & "*" Or Me.[Document No] Like "14" & "*" Then
Me.Registration_Label.Visible = True
Me.Registration_Type.Visible = True
Me.LTO_Label.Visible = True
Me.LTO.Visible = True
Else
Me.Registration_Label.Visible = False
Me.Registration_Type.Visible = False
Me.LTO_Label.Visible = False
Me.LTO.Visible = False
If Me.[Document No] Like "10" & "*" Then
Me.IOGC_Label.Visible = True
Me.IOGG_Band.Visible = True
Else
If Me.[Document No] <> "10" & "*" Then
Me.IOGC_Label.Visible = False
Me.IOGG_Band.Visible = False
If Me.[Document No] Like "16B-" & "*" Then
Me.Party1.Visible = True
Me.Party2.Visible = True
Me.A_nN_Label.Visible = True
Me.Party1_Label.Visible = True
Me.Party2_Label.Visible = True
Else
If Me.[Document No] <> "16B-" & "*" Then
Me.A_nN_Label.Visible = False
Me.A_nN.Visible = False
Me.A_nN.Visible = False
Me.Party1_Label.Visible = False
Me.Party2_Label.Visible = False
Me.Party1.Visible = False
Me.Party2.Visible = False
End If
End If
End If
End If
End If
End If
End If
End If
End Sub






