Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008

    Unanswered: Requery field in subform

    I've got a form (frmTimeCard) with a subform (frmTimeCardSubform) attached to it. On frmTimeCard, there is a button that allows the user to add a new project number. It bring up a modal form (frmProjects) in Add view. Everythign works fine except the requery. If I don't have any control filled in on the main form or subform, then the drop down in the subform for projects shows the new project number. If I have the controls filled in, it doesn't show the new project number. The subform is in datasheet view, my code is listed below. If someone could help me figure out how to get the updated projects list to show in the drop down, that'd be perfect.

    Private Sub Form_Close()
    Forms!frmTimeCard![Time Card Subform].Form.Requery
    End Sub
    P.S.-frmProjects writes back to tblProjects which is where my drop down pulls it's list from.

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    DoCmd.Save is not right.

    DoCmd****nCommand accmdSaveRecord is what you would use to save the data. I think your command saves the form design.

    FFS. Noob forum

    Replace those asterisks with DOT R U.... it should read DoCmd<dot>RunCommand. I think the noob admins are trying to filter out links to russian pages, but they suck at coding and let such things attack member postings :BangHeadOnWall:
    Last edited by StarTrekker; 05-24-09 at 22:30.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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