Originally Posted by
HubCon
DaveGri
I have tried similar to this but it did not work before. Tried exactly as you have written, and it appeared to have no effect. Then tried editing a number, and found it was possible. I could not add a new item though.
I added another line with AllowAdditions, and this again "appeared" not to work. Tried again, and it worked. I think possibly I've been using only AllowEdits or Enabled, and this has confused me when viewing an empty sub-form. My poor knowledge of what is a sub-form is, and how it is controlled has thrown me.
I have spent hours on this, and got nowhere, and yet a simple suggestion has helped clarify the requirement, and my understanding. Your help is very much appreciated.
This way works for me.
Code:
Private Sub cmdButFuniqueEditMode_Click()
Forms!Funique.cmdSaveCloseFunique.Visible = True
ToolDescription.SetFocus
Forms!Funique.cmdButFuniqueEditMode.Visible = False
Forms!Funique.AllowEdits = True
Me.FQUsedOnSubForm.Form.AllowEdits = True
Me.FQUsedOnSubForm.Form.AllowAdditions = True
'FQUsedOnSubForm.SetFocus
'Me.AllowEdits = True
'Forms!Funique.FQUsedOnSubForm.Form.PartNumber.AllowEdits = True
'Me.FQUsedOnSubForm.Enabled = True
'Me.FQUsedOnSubForm.Locked = False
'Me!page1.FQUsedOnSubForm.Form.AllowEdits = True
'Forms![Funique]![FQUsedOnSubForm].Enabled = True
'Forms![Funique]![FQUsedOnSubForm].Form.Enabled = True
'Forms!Funique.FQUsedOnSubForm.Form.AllowEdits = True
End Sub
Edit: Also need .AllowAdditions=True
to enable adding recs in subform.