• Coding between a new data form and a main form combo box

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Coding between a new data form and a main form combo box

    • This topic has 2 replies, 2 voices, and was last updated 10 years ago.
    Author
    Topic
    #500347

    Hi,
    Would like to request help coding an event. I’m using Access 2013.

    I have a main table of tblEntries and a form based on it called frmEntries. Within frmEntries are tab pages. The box for all the tabs is called tabEntriesAllTabs. Page zero of the tabs is tabEntriesNames. Within it is a subform, frmEntriesNames and it has a combo box called cboIDNames. I have a many-to-many relationship between tblEntries and tblNames.

    In the footer of the frmEntries, I have a button to Add New Names which opens up frmAddNames, using DoCmd.OpenForm “frmAddNames”, acNormal, , , acFormAdd. Got this code from a website.

    In frmAddNames, I have two buttons. One button, cmdNameAddAnother, just moves to a new record. The second button I would like help with. I would like it to close frmAddNames and requery cboIDNames from the main form. This is where I’m totally lost. I suspect I need to point Access to the right place, and just can’t get there, since one action is on the form currently in use and the other action is for a second form.

    This is a database of historical records for my local historical society. Additional tabs will be Subjects, Locations, and Legal Descriptions. All of which have many-to-many relationships and datasheet subforms, and will require the same new data form and coding.

    Would appreciate any assistance.

    Sue

    Viewing 0 reply threads
    Author
    Replies
    • #1508746

      If your combobox is on your main form, requerying it is as simple as:

      Forms!frmEntries!cboIDNames.Requery

      • #1508750

        Mark,
        The requery does work, but I’m not sure how to requery and close the form. I tried this, but it didn’t work.
        Private Sub cmdCloseAddNames_Click()

        End Sub

        Private Sub Form_Click()

        Forms!frmEntries!cboIDNames.Requery

        DoCmd.Close acForm, “frmAddNames”, acSaveYes

        End Sub

        Thanks,

        Sue

    Viewing 0 reply threads
    Reply To: Coding between a new data form and a main form combo box

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

    Your information: