It seems stupid and I never had this problem before (Delphi, VB).
Using Access 2007 and trying to change a label's Caption at runtime (OnCurrent event of a form). I did DoEvents, I did Me.Repaint, but the **** label displays the same caption.
(the same is True with a command button, it changes is Caption only when I click on it)
Still, the form goes in AllowEdits and AllowDeletitions.
It behaves like an event is not raised.
Here's te code...
Private Sub Form_Current()
' other stuff
If GetUserRights(Me![sAreaCode]) = False Then
Me.AllowDeletions = False
Me.AllowEdits = False
Me.lblTitle.Caption = "Location - R/O"
Else
Me.AllowDeletions = True
Me.AllowEdits = True
Me.lblTitle.Caption = "Location - R/W"
End If
Me.Repaint
DoEvents
End Sub
Using Access 2007 and trying to change a label's Caption at runtime (OnCurrent event of a form). I did DoEvents, I did Me.Repaint, but the **** label displays the same caption.
(the same is True with a command button, it changes is Caption only when I click on it)
Still, the form goes in AllowEdits and AllowDeletitions.
It behaves like an event is not raised.
Here's te code...
Private Sub Form_Current()
' other stuff
If GetUserRights(Me![sAreaCode]) = False Then
Me.AllowDeletions = False
Me.AllowEdits = False
Me.lblTitle.Caption = "Location - R/O"
Else
Me.AllowDeletions = True
Me.AllowEdits = True
Me.lblTitle.Caption = "Location - R/W"
End If
Me.Repaint
DoEvents
End Sub