Cannot edit subform

  • Thread starter Thread starter smiley
  • Start date Start date
S

smiley

I have a form that has AllowEdit set to No and a button that when pressed
sets it to yes. The problem is, when I press the button, I can edit the form,
but not the subform. If I set the AllowEdits to Yes and open the form, I can
edit the subform.

How can get the subform to allow edits when I press the edit button I have?
Here is the event code for the button:

Private Sub cmdEditMode_Click()
Dim ID As Variant
Dim FilterState As Variant

ID = Me.CurrentRecord
FilterState = Me.FilterOn

Me!cmbFundGoTo.Enabled = False
Me!cboAsOfDate.Enabled = False
Me.AllowEdits = True
Me.AllowAdditions = False
Me.AllowDeletions = True
Me.DataEntry = False
Me.Section(acDetail).BackColor = 8421631
Me.FilterOn = FilterState
DoCmd.GoToRecord , , acGoTo, ID
End Sub
 
Is the query underlying the subform editable? If not, Allow Edits for the
subform is irrelevant.
 
Yes, the subform is based on a table and it is editable, but I don't want to
allow edits unless the button is pressed. How do I set the subform AllowEdits
to yes when I press the edit button?
 
Back
Top