• form/subform issue (2002)

    Author
    Topic
    #434408

    I have a form that I setup a button to allow edits to fields on the form. Works great.
    I then added a linked subform to the original form. I can not edit data on the subform.
    I asume that I have to add some code to my main form that will allow edits on the subform. I can’t get the coding right.
    Here is the code behind the original edit button:

    Private Sub cmdEdit_Click()
    Me.AllowEdits = True
    Me.LNFN.SetFocus
    cmdEdit.Visible = False
    CmdSave.Visible = True
    Me.lblEditMode.Visible = True
    End Sub

    I think I have to add a line something like this:

    Forms!subformCertifiedSports.AllowEdits = True

    Doesn’t work. What am I missing?

    Thanks.

    Paul

    Viewing 1 reply thread
    Author
    Replies
    • #1024038

      I’m guessing that the subform control itself has its Enabled and/or Lock properties set incorrectly.

    • #1024048

      See Mark’s reply.

      By the way, the code would look different. Subforms are not part of the Forms collection. It would be like this:

      Me!subformCertifiedSports.Form.AllowEdits = True

      where subformCertifiedSports should be the name of the subform as a control on the main form, this is not necessarily the same as the name of the subform in the database window.

    Viewing 1 reply thread
    Reply To: form/subform issue (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: