I have a button on a subform to allow the user to edit the current record. By default the subform is set to AllowEdits =false, and the button is coded:
So it should work as a simple toggle to allow/deny editing of the existing data...
The problem is that when it is in 'Save Date' mode and is clicked the controls on the form remain editable... even though I can confirm that allowedits=false (Immediate window).
Is there something I'm missing? Should I send a save record command before allowedits=false? Is it enough to have the form set to allowedits=false in design view or do I need to force it to this OnOpen?
Help please?
Phil
Phil
---------------
Pass me the ether.
Code:
Private Sub ButEditDate_Click()
'Allow edits for subform, and changes edit button to a 'save' button
If Me.ButEditDate.Caption = "Edit Date" Then
Me.Form.AllowEdits = True
Me.ButEditDate.Caption = "Save Date"
Me.BoxLabNr.SetFocus
Else
Me.ButEditDate.Caption = "Edit Date"
Me.Form.AllowEdits = False
End If
End Sub
So it should work as a simple toggle to allow/deny editing of the existing data...
The problem is that when it is in 'Save Date' mode and is clicked the controls on the form remain editable... even though I can confirm that allowedits=false (Immediate window).
Is there something I'm missing? Should I send a save record command before allowedits=false? Is it enough to have the form set to allowedits=false in design view or do I need to force it to this OnOpen?
Help please?
Phil
Phil
---------------
Pass me the ether.