Expression comparing fields from 2 forms

  • Thread starter quinto via AccessMonster.com
  • Start date
Q

quinto via AccessMonster.com

Can I palce a text box in a form with an expression to compare 2 fields? one
from the main form and one from a subform? The following is not working
=[VehiclesDayMiles:Opening MilesT]-[VehiclesDayMilesLastByGroupQ:
LastOfClosing Miles]

Thanks

Quinto
 
J

John W. Vinson

Can I palce a text box in a form with an expression to compare 2 fields? one
from the main form and one from a subform? The following is not working
=[VehiclesDayMiles:Opening MilesT]-[VehiclesDayMilesLastByGroupQ:
LastOfClosing Miles]

Thanks

Quinto

Bear in mind that a subform will typically contain many records. Do your
fieldnames actually contain colons??? Are these table fields or controls on
the form - if controls, are they bound to table fields or is the subform field
in the form footer or the like?

TRY this (though I rather doubt it will work):

=[VehiclesDayMiles:Opening MilesT] -
[Subformname].Form![VehiclesDayMilesLastByGroupQ:
LastOfClosing Miles]

where Subformname is the name of the Subform control (which might or might not
be the same as the name of the form within that control).

John W. Vinson [MVP]
 
Q

quinto via AccessMonster.com

Thanks you.

I decided to post the numbers for reference only.
Last day closing miles should be less than today's opening miles.
I was going to put in an expression and a conditional format that if the
result was negative it would show in bold red.

Thanks again
Quinto
Can I palce a text box in a form with an expression to compare 2 fields? one
from the main form and one from a subform? The following is not working
[quoted text clipped - 4 lines]

Bear in mind that a subform will typically contain many records. Do your
fieldnames actually contain colons??? Are these table fields or controls on
the form - if controls, are they bound to table fields or is the subform field
in the form footer or the like?

TRY this (though I rather doubt it will work):

=[VehiclesDayMiles:Opening MilesT] -
[Subformname].Form![VehiclesDayMilesLastByGroupQ:
LastOfClosing Miles]

where Subformname is the name of the Subform control (which might or might not
be the same as the name of the form within that control).

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks you.

I decided to post the numbers for reference only.
Last day closing miles should be less than today's opening miles.
I was going to put in an expression and a conditional format that if the
result was negative it would show in bold red.

Ok... did your question get answered? Is it working now?

John W. Vinson [MVP]
 
Q

quinto via AccessMonster.com

I did not try it yet because I went with an alternastive way but I will as
try it as make other changes.
It seams that every day I come up with something to make more user friendlier.
I dont think I will ever stop adding to this project.

Thanks

Quinto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top