So, there's the ole "Parent" form and "Child" form.
These work very well and the information pulled is correct; however, we want the elapsed time between entries that show on the sub form.
Not an issue, I've done this a ton of times in reports and on a normal form:
Unbound Textbox named z_ctrl_txt_elap seddays
The control source is (I've stepped this for reading):
When the Parent is opened all is well. The dates calcuted are correct and I'm happy; however, occasionally, the subform is used directly (basically when I don't need a filter) and ofcourse
So, is there a way to trap #ERROR in an unbound control?
[{edit:2013.02.1 2} to be clear, VBA is not the answer I need as the form will occationally be opened on workstations where the VBA is disabled]
These work very well and the information pulled is correct; however, we want the elapsed time between entries that show on the sub form.
Not an issue, I've done this a ton of times in reports and on a normal form:
Unbound Textbox named z_ctrl_txt_elap seddays
The control source is (I've stepped this for reading):
Code:
=DateDiff("d", DLast("[history_date]", "qry_history_subform", "[History_fk_inventory]= Forms![ParentFormName]![SubFormName]![history_fk_inventory] AND [history_pk]<= Forms![ParentFormName]![SubFormName]![history_pk]-1"), [history_date]))
Forms![ParentFormName]![SubFormName]
tosses an #ERROR at me. Now, I've written a custom function that checks to see if Forms![ParentFormName]![SubFormName]
tosses an error and if so then runs the formula without that reference. However, I'd like to do the check directly within the control. I've tried a dozen different checks and the like; however, I've been stumped with this one. "IIF" doesn't work and so forth.So, is there a way to trap #ERROR in an unbound control?
[{edit:2013.02.1 2} to be clear, VBA is not the answer I need as the form will occationally be opened on workstations where the VBA is disabled]
Comment