F
Faraz Ahmed Qureshi
I want a few controls/text boxes to be visible only if the text box LOCATION
consists the entry Branch. Following piece of code results into be working
upon only upon the first record. In other words, once the controls become
visible they don't hide upon the next Non-Branch record unless I move the
scroll bars.
What might be the reason???
Every time I need to move within the new/current record by moving the scroll
bars to have the boxes be visible/not depending upon the LOCATION.
Private Sub Form_current()
If Me.Location <> "Branch" Then
Me.Br_T24_Code.Visible = False
Me.Branch_Name.Visible = False
Me.Address.Visible = False
Me.City.Visible = False
Me.Region.Visible = False
Me.Phone1.Visible = False
Me.Phone2.Visible = False
Me.Phone3.Visible = False
Me.Br_status.Visible = False
Me.Br_T24_Code.Enabled = False
Me.Branch_Name.Enabled = False
Me.Address.Enabled = False
Me.City.Enabled = False
Me.Region.Enabled = False
Me.Phone1.Enabled = False
Me.Phone2.Enabled = False
Me.Phone3.Enabled = False
Me.Br_status.Enabled = False
Else
Me.Br_T24_Code.Visible = True
Me.Branch_Name.Visible = True
Me.Address.Visible = True
Me.City.Visible = True
Me.Region.Visible = True
Me.Phone1.Visible = True
Me.Phone2.Visible = True
Me.Phone3.Visible = True
Me.Br_status.Visible = True
Me.Br_T24_Code.Enabled = True
Me.Branch_Name.Enabled = True
Me.Address.Enabled = True
Me.City.Enabled = True
Me.Region.Enabled = True
Me.Phone1.Enabled = True
Me.Phone2.Enabled = True
Me.Phone3.Enabled = True
Me.Br_status.Enabled = True
End If
Me.Recalc
End Sub
consists the entry Branch. Following piece of code results into be working
upon only upon the first record. In other words, once the controls become
visible they don't hide upon the next Non-Branch record unless I move the
scroll bars.
What might be the reason???
Every time I need to move within the new/current record by moving the scroll
bars to have the boxes be visible/not depending upon the LOCATION.
Private Sub Form_current()
If Me.Location <> "Branch" Then
Me.Br_T24_Code.Visible = False
Me.Branch_Name.Visible = False
Me.Address.Visible = False
Me.City.Visible = False
Me.Region.Visible = False
Me.Phone1.Visible = False
Me.Phone2.Visible = False
Me.Phone3.Visible = False
Me.Br_status.Visible = False
Me.Br_T24_Code.Enabled = False
Me.Branch_Name.Enabled = False
Me.Address.Enabled = False
Me.City.Enabled = False
Me.Region.Enabled = False
Me.Phone1.Enabled = False
Me.Phone2.Enabled = False
Me.Phone3.Enabled = False
Me.Br_status.Enabled = False
Else
Me.Br_T24_Code.Visible = True
Me.Branch_Name.Visible = True
Me.Address.Visible = True
Me.City.Visible = True
Me.Region.Visible = True
Me.Phone1.Visible = True
Me.Phone2.Visible = True
Me.Phone3.Visible = True
Me.Br_status.Visible = True
Me.Br_T24_Code.Enabled = True
Me.Branch_Name.Enabled = True
Me.Address.Enabled = True
Me.City.Enabled = True
Me.Region.Enabled = True
Me.Phone1.Enabled = True
Me.Phone2.Enabled = True
Me.Phone3.Enabled = True
Me.Br_status.Enabled = True
End If
Me.Recalc
End Sub