M
mmm_danone
On my form there is a toggle button for Edit & Read-Only modes. The
default is Read Only, so user clicks the button and can edit all
fields.
However, if you click a navigation button, or anything to get another
record up (ie filter), then the toggle button still says Edit mode, but
the form is in fact Read Only. If you click the toggle twice (to
Read-Only then back to Edit), you can edit the record ok. How can I
fix this, so the user doesn't have to toggle twice? I'd like to be
able to move from record-to-record in Edit mode.
Here's my code...
Private Sub Form_Current()
Me.AllowEdits = False
End Sub
Private Sub Form_AfterUpdate()
If Me!Toggle202 Then Me.AllowEdits = True
If Me!Toggle202 = False Then Me.Refresh: Me.AllowEdits = False
End Sub
Private Sub Toggle202_Click()
If Me!Toggle202 = True Then
Me!Toggle202.Caption = "EDIT MODE"
ElseIf Me!Toggle202 = False Then
Me!Toggle202.Caption = "READ ONLY MODE"
End If
End Sub
Private Sub Toggle202_GotFocus()
Me.AllowEdits = True
End Sub
Private Sub Toggle202_LostFocus()
Me.AllowEdits = Me!Toggle202
Me.Refresh
End Sub
TIA
Jon
default is Read Only, so user clicks the button and can edit all
fields.
However, if you click a navigation button, or anything to get another
record up (ie filter), then the toggle button still says Edit mode, but
the form is in fact Read Only. If you click the toggle twice (to
Read-Only then back to Edit), you can edit the record ok. How can I
fix this, so the user doesn't have to toggle twice? I'd like to be
able to move from record-to-record in Edit mode.
Here's my code...
Private Sub Form_Current()
Me.AllowEdits = False
End Sub
Private Sub Form_AfterUpdate()
If Me!Toggle202 Then Me.AllowEdits = True
If Me!Toggle202 = False Then Me.Refresh: Me.AllowEdits = False
End Sub
Private Sub Toggle202_Click()
If Me!Toggle202 = True Then
Me!Toggle202.Caption = "EDIT MODE"
ElseIf Me!Toggle202 = False Then
Me!Toggle202.Caption = "READ ONLY MODE"
End If
End Sub
Private Sub Toggle202_GotFocus()
Me.AllowEdits = True
End Sub
Private Sub Toggle202_LostFocus()
Me.AllowEdits = Me!Toggle202
Me.Refresh
End Sub
TIA
Jon