G
Guest
I have a form with two subforms in it, and I'm trying to get the second
subform to read a value from the first subform, and I'm wondering if anyone
here might have a handle on it.
The situation: In the second subform, you select OTR (Over the road) or Rail
for method of transport. When you go to the next field, Receive Date, it
should look at the value in the first subform for either OTR or Rail, and add
that number of days to the Ship Date (in 2nd form) to show you the date the
shipment will arrive.
I'm using the On Enter area so the user can select transport type, and get
the right info when they click into the field. It basically says, if user
selected OTR, look in the 1st subform for the value of OTR and add that, else
it looks in the Rail value and adds that # of days.
The expression I'm using is (I've tried normal quotes around OTR also):
=IIf([ShipType]='OTR',[RecvDate]=[RecvDate]+[Forms]![Form-Main]![Form-Main_Sub-LocationInfo].[OTR],[Forms]![Form-Main]![Form-Main_Sub-LocationInfo].[Rail])
It's like that when I enter it, but after I've tried it, it removes some
important looking brackets to come up like this:
=IIf([ShipType]='OTR',[RecvDate]=[RecvDate]+Forms![Form-Main]![Form-Main_Sub-LocationInfo].OTR,Forms![Form-Main]![Form-Main_Sub-LocationInfo].Rail)
The error I receive is:
The expression On Enter you entered as the event property setting produced
the following error: The object doesn't contain the Automation object 'OTR.'."
Any help at all would be very very appreciated!
Thanks!
Steph
subform to read a value from the first subform, and I'm wondering if anyone
here might have a handle on it.
The situation: In the second subform, you select OTR (Over the road) or Rail
for method of transport. When you go to the next field, Receive Date, it
should look at the value in the first subform for either OTR or Rail, and add
that number of days to the Ship Date (in 2nd form) to show you the date the
shipment will arrive.
I'm using the On Enter area so the user can select transport type, and get
the right info when they click into the field. It basically says, if user
selected OTR, look in the 1st subform for the value of OTR and add that, else
it looks in the Rail value and adds that # of days.
The expression I'm using is (I've tried normal quotes around OTR also):
=IIf([ShipType]='OTR',[RecvDate]=[RecvDate]+[Forms]![Form-Main]![Form-Main_Sub-LocationInfo].[OTR],[Forms]![Form-Main]![Form-Main_Sub-LocationInfo].[Rail])
It's like that when I enter it, but after I've tried it, it removes some
important looking brackets to come up like this:
=IIf([ShipType]='OTR',[RecvDate]=[RecvDate]+Forms![Form-Main]![Form-Main_Sub-LocationInfo].OTR,Forms![Form-Main]![Form-Main_Sub-LocationInfo].Rail)
The error I receive is:
The expression On Enter you entered as the event property setting produced
the following error: The object doesn't contain the Automation object 'OTR.'."
Any help at all would be very very appreciated!
Thanks!
Steph