Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2010
    Location
    Stevens County, WA, USA
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    If your combobox is on your main form, requerying it is as simple as:

    Forms!frmEntries!cboIDNames.Requery
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    New Lounger
    Join Date
    Dec 2010
    Location
    Stevens County, WA, USA
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •