Results 1 to 9 of 9

Thread: Subform Refresh

  1. #1
    Join Date
    Sep 2003
    Posts
    12

    Unanswered: Subform Refresh

    I have a main form, subform 1 and subform 2 for entering Donor information. The subforms are linked to the main form with master/child fields, donor id. When a donor is added to the database, three tables are updated: tblDonors, tblContacts, tblNonProfitDonors. The record source for the main form is tblDonors, which requires a record before records can be added for tblContacts and tblNonProfitDonors. Records are updated with the following on-click event procedure, which is tied to the save button on subform 2.

    Private Sub cmdSave_Click()
    On Error GoTo Err_cmdSave_Click


    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Exit_cmdSave_Click:
    Exit Sub


    On subform 1, I use an if then statement to disable a text box based on the value selected for a combo box on the same subform. All works fine with the first add, but I have a problem refreshing subform 1 when doing multiple adds. I need to enable the text box that was disabled from the previous add. Currently, this requires that I close the main form and reopen. I've tried to add refresh/requery to the event procedure, but I believe this hasn't worked because it is tied to subform 2. I would greatly appreciate any help and I am glad to submit the database to anyone willing to take a look.

    RDCD
    Nonprofit Access User

  2. #2
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    Pass the database over here, ill take a look!

  3. #3
    Join Date
    Sep 2003
    Posts
    12

    Database attached

    Thanks so much. A scaled-down version is attached.

    RDCD
    Attached Files Attached Files
    Nonprofit Access User

  4. #4
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169

    Hi

    Post in here when you are online, just need to ask a few things, I think i know what you mean and i think i have sorted it but need to have a word with you first to make sure!

  5. #5
    Join Date
    Sep 2003
    Posts
    12

    Subform Refresh

    Thanks Chris....I am working until about 2:30 PM EST 9/21 and will check the forum.
    Nonprofit Access User

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To refresh a subform just use:

    Forms!mainForm!yourSubForm.Form.Refresh

  7. #7
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    We are working on a major time difference here I think. Will pos what i have done one here and you can take a look

  8. #8
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169

    Sorry

    Sorry taken so long to post this, been really busy. Here is the form as i see you wanting it to work, does this work for you?
    Attached Files Attached Files

  9. #9
    Join Date
    Sep 2003
    Posts
    12

    Subform Refresh

    Chris....this works perfectly. Thanks so much for your time and effort with this. I wasn't close with the refresh or requery.

    RDCD
    Nonprofit Access User

Posting Permissions

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