L
Liz C
Hi!
I'm trying to set the value of a field in a form to a number I'm looking up
in a table where it's between certain dates on the form.
Here's the expression in my macro (set value action, to set the value of the
Fuel textbox on my form):
=DLookUp("[FAC_PCT]","RInjFPct","[EFF_END_DT]<=Forms!DateF!ProdEnd and
[EFF_START_]>=Forms!DateF!ProdBeg")
I have 12/1/2005 as the ProdBeg date on the form and 12/31/2005 as the
ProdEnd date on the form. In the RInjFPct table, there is a record where
EFF_END_DT is 4/1/2006 and EFF_START_ is 4/1/2005 and the FAC_PCT is 1.04, so
it should pick this up. I also tried doing the DLookup directly in a text
box on the form and it still gives me a blank. If I type in a text box the
actual dates, rather than referring to the form, it works. Also, If I just
ask for one criteria based on the form, it works, but when I put the "and"
part in, it doesn't.
Thank you in advance for your help!
I'm trying to set the value of a field in a form to a number I'm looking up
in a table where it's between certain dates on the form.
Here's the expression in my macro (set value action, to set the value of the
Fuel textbox on my form):
=DLookUp("[FAC_PCT]","RInjFPct","[EFF_END_DT]<=Forms!DateF!ProdEnd and
[EFF_START_]>=Forms!DateF!ProdBeg")
I have 12/1/2005 as the ProdBeg date on the form and 12/31/2005 as the
ProdEnd date on the form. In the RInjFPct table, there is a record where
EFF_END_DT is 4/1/2006 and EFF_START_ is 4/1/2005 and the FAC_PCT is 1.04, so
it should pick this up. I also tried doing the DLookup directly in a text
box on the form and it still gives me a blank. If I type in a text box the
actual dates, rather than referring to the form, it works. Also, If I just
ask for one criteria based on the form, it works, but when I put the "and"
part in, it doesn't.
Thank you in advance for your help!