Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85
    After further working on this issue, I have added this;

    Me.ordVendor.SetFocus

    into the OnCurrent event for the main form.

    Now, when switching from Datasheet view to Form view; the focus is set on the form. Before this additional .setfocus, when switching from Datasheet to Form view, the 'highlight' or focus, was on the left side of the form. I don't know what that area is called, but it would be highlighted.

    I think this may get me started in some way now that I am on the form, to find an event so that I may requery the subform. I am hoping that requerying the subform would 'change' the default value to the correct value.



    It is almost like the calculations being done upon opening the form/subform is too fast and grabs the first record, not the record information I am on.

    IE: I am still working on this 'fix'.......

    Tim

  2. #17
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85
    Yes, I am still working on this problem when I find time. I ran across this while reading, and it seemed to be what is happening to me. When I am in Datasheet View of the Form, then switch to Form View; the subform is populated by it's defaults. However, since the Form has not been read yet, it probably is just grabbing the first record to use for it's default field values. So it may seem that I need to trigger an 'activate' event AFTER the form is loaded so that any default values with calculations from a SUBFORM, can be calculated properly.

    Just thinking out loud............

    The reason I think this is because if the subform is loaded before the main form, the record needed for this open from datasheet view may be record #2309, but it hasn't loaded that record yet upon an opening/changing of view.


    Subform events:
    When you open a form containing a subform, the subform and its records are loaded before the main form. Thus, the events for the subform and its controls (such as Open, Current, Enter, and GotFocus) occur before the events for the form. The Activate event doesn't occur for subforms, however, so opening a main form triggers an Activate event only for the main form.


    Tim

  3. #18
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85
    Continued on.....

    https://www.accessforums.net/forms/d...tml#post136700

    Now solved.

    Thanks to all who have contributed.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Formatting a Calculated Field
    By e_lady333 in forum Queries
    Replies: 0
    Last Post: 03-17-2010, 06:11 PM
  2. Sum of calculated fields
    By nkuebelbeck in forum Forms
    Replies: 9
    Last Post: 03-12-2010, 01:32 PM
  3. Set Calendar to default to today's date
    By RickM in forum Access
    Replies: 1
    Last Post: 02-22-2009, 04:51 AM
  4. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 AM
  5. calculated sum not working!
    By Linda Gamble in forum Access
    Replies: 1
    Last Post: 10-12-2007, 06:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums