2 forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom

    2 forms

    I totally new to Access.
    I created 2 forms with a button on the main form to call up the second, e.g.
    mileage exp.
    I have an expression on the second form to subtract start and finish
    mileage, I want the result to display on the main form.
    My difficulty is, the result from the second form will appear in the correct
    field but in all the records on my main form. I have set up relationships
    from the result field on the second form to the field on my main form. I
    also used the OnCurrent expression.
    I would like to link the correct fields to the correct records and I don't
    really want to create a sub-form because it shows on the main form and gives
    a cluttered look.
    If possible I would like to have a save button that would close the second
    form so I can continue entering data before moving onto the next record,
    with the mileage exp field empty.
    I trawled through the help, maybe I don't know how to phrase the correct
    question.

    Many Thanks in advance
    Tom Brett


  • Jeff Leckrone

    #2
    Re: 2 forms

    I'm not totally sure what your second form does, but it sounds to me
    like it's only calculating total mileage. You could easily perform
    the calculation on your main form. If the mileages are in your record
    set for the form, all you would need to do is put =EndMileage -
    StartMileage in the box on your main form where mileage is calculated.
    If not you could use other methods, like DLookup. The reason you are
    getting the same result for all the records on the main form is
    because the field on the main form is not bound to anything. I hope I
    helped you somewhat.

    Comment

    • Tom

      #3
      Re: 2 forms

      Hello Jeff
      I Thank you so much for your time and input.
      You are correct about the second form, it only calculates mileage.
      I will try to bind the calculated mileage field first, if this fails me I
      will go with your suggestion and perform the calculation on the main form.

      Renewed Thanks
      Tom


      "Jeff Leckrone" <jleckrone@hotm ail.com> wrote in message
      news:e2d30396.0 407260558.2fcaa 910@posting.goo gle.com...[color=blue]
      > I'm not totally sure what your second form does, but it sounds to me
      > like it's only calculating total mileage. You could easily perform
      > the calculation on your main form. If the mileages are in your record
      > set for the form, all you would need to do is put =EndMileage -
      > StartMileage in the box on your main form where mileage is calculated.
      > If not you could use other methods, like DLookup. The reason you are
      > getting the same result for all the records on the main form is
      > because the field on the main form is not bound to anything. I hope I
      > helped you somewhat.[/color]


      Comment

      Working...