Cannot edit subform

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
 
N

nomadk

Is the query underlying the subform editable? If not, Allow Edits for the
subform is irrelevant.
 
S

smiley

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top