Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    61

    Unanswered: How can I force a refresh on a subform?

    Hello to All,

    I have a subform on my main form showing records for which ever user is logged onto the machine though as records are added to the table I want to force the subform to refresh to show those new records. How do I do this?

    Thanks in advance for all your assistance.


    Mythos

  2. #2
    Join Date
    Nov 2005
    Posts
    113
    You do:
    Form_frmMain.frmSubform.Requery

  3. #3
    Join Date
    Apr 2005
    Posts
    61

    Ok another question on this

    How could I have this now query the table for a certain Employee number?
    Say i have one button with Employee 1 and another button with Employee 2
    when you click button 1 All of Employee 1's records are filtered and show up in the subform and then with button 2 all of Employee 2's records are filtered and show up ini the subform.

    Thanks again

    Mythos

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Do you have the links (i.e. view properties of the subform on your main form - Link Child Fields, Link Master Fields) set to link on your primary/foreign key fields. If you have relationships set up between your main table (which your main form is based on) and your relational table (which your sub form should be based on), then you shouldn't even need to requery your subform as requerying your main form should refresh your subform. But it sounds like you have things set up a little different and I'm a little confused on what your structure is but you can set the filter or change the recordsource of the subform on the onclick events of your buttons. Not to confuse you but I don't think I understand what you're trying to do. I guess the question would be what kind of information is on your main form and sub form and what tables (recordsources) are each of those based on? Is your subform based on the same table as your main form?
    Last edited by pkstormy; 11-14-06 at 15:57.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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