Hi there,
I have a form with two subforms. I set the RecordSource property for each subform progammatically by setting it to an SQL statement. This works, however, the subforms are read only. I can't edit them for updates to the appropriate tables.
I created a button for each subform on the main form which is supposed to change the behaviour from read only to editable, but the code I'm using is not working as hoped. See below for code of one of the buttons:
Please advise,
Alan
I have a form with two subforms. I set the RecordSource property for each subform progammatically by setting it to an SQL statement. This works, however, the subforms are read only. I can't edit them for updates to the appropriate tables.
I created a button for each subform on the main form which is supposed to change the behaviour from read only to editable, but the code I'm using is not working as hoped. See below for code of one of the buttons:
Code:
'At top of main form
Dim LLUnlocked As Boolean
Private Sub cmdLLUnlock_Click()
If LLUnlocked = False Then
Me.cmdLLUnlock.SetFocus
Me.cmdLLUnlock.Caption = "Lock Table"
Me.frmLANDLINES.Form.AllowAdditions = True
Me.frmLANDLINES.Form.AllowEdits = True
Me.frmLANDLINES.Form.AllowDeletions = True
LLUnlocked = True
Else
Me.cmdLLUnlock.SetFocus
Me.cmdLLUnlock.Caption = "Unlock To Edit"
Me.frmLANDLINES.Form.AllowAdditions = False
Me.frmLANDLINES.Form.AllowEdits = False
Me.frmLANDLINES.Form.AllowDeletions = False
LLUnlocked = False
End If
End Sub
Please advise,
Alan