I've used code similar to the following in the "On Retrieve Spec Open" event for years:
FormFieldValue("Main Form", "Date_entered", 1, "=")
That works great on the main form. I now have a need to do this with subforms, but it doesn't work on subforms.
I can read a value from a subform with @FormFieldValue, but cannot set a value there with FormFieldValue. Here's the actual code I'm using to test with:
var vStr as String
vStr = @LoadRetrieveSpec("Temp")
WriteLn(@FormFieldValue("Checkbook Transactions", "Note", 0))
FormFieldValue("Checkbook Transactions", "Note", 0, "TEST")
WriteLn(@FormFieldValue("Checkbook Transactions", "Note", 0))
For testing purposes, the I'm using the "Temp" retrieve spec to put something in the subform Note field, so that I have something to read when @FormFieldValue reads it. That gets displayed in the WriteLn slate. - Works great.
But, when FormFieldValue attempts to set a new value in the subform Note field, and again, @FormFieldValue reads the Note field, it displays the same thing as the first read.
I'm hoping Ray has a solution.