Results 1 to 6 of 6
  1. #1
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202

    Question MainForm/SubForm question


    How do I have my statements know which record to check on the corresponding Subform? I want them to use the data relating to the most recent entry but I don't know what kind of coding I need to use to make that happen.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    When you set up Form and subForm did you do this
    http://office.microsoft.com/en-us/ac...010098674.aspx

  3. #3
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Yeah. That's all setup. I just need to what the modifier is to make my expression reference the latest data entry on a given form, is there a general command for this?

  4. #4
    tiuliucci is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    2

    After Update Function

    Quote Originally Posted by 10 Gauge View Post
    Yeah. That's all setup. I just need to what the modifier is to make my expression reference the latest data entry on a given form, is there a general command for this?
    I think you are trying to get an update made on the subform to force a change on the main form. If that is your goal, the way to do that is to use the After Update function on the Subform. You can use this function on either the field level or form level in the Properties list and use VB code to instruct the updates to the main form that you need.

    Take care,
    Troy

  5. #5
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    This is what I am trying to do, let me give you the specific example....

    I would like a text box on the main form to perform an equation between the most recent data entered in one subform and the data from another subform and then display a message in the text box depending on the outcome of the equation.

    Such as...

    IF subform1 mileage minus subform2 mileage is less than 250
    THEN display "PM Service Due" on mainform

    The trick though is that mileage is entered weekly for each vehicle in the fleet and I want the equation to ONLY reference the most recent mileage entered.

    An illustrated example is attached.

  6. #6
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Did that make any sense?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Subform question
    By Wayne311 in forum Forms
    Replies: 34
    Last Post: 01-26-2011, 11:42 AM
  2. Filter a subform based on mainform
    By Cheshire101 in forum Queries
    Replies: 3
    Last Post: 01-06-2011, 12:56 PM
  3. Subform Question
    By Desverger in forum Forms
    Replies: 1
    Last Post: 08-11-2010, 02:42 PM
  4. Replies: 0
    Last Post: 03-14-2009, 12:33 AM
  5. copying data from subform to mainform
    By wasim_sono in forum Forms
    Replies: 0
    Last Post: 03-10-2006, 04:35 AM

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