Is it possible to use Visibility/ReadOnly on a subform element on a TabPage ? I have not been able to find a way to do this. (1.0.5Beta)
Here is structure: Main form has three tabs: A,B,C Tab A has multiple common elements for Orders. Tab B only has one element, a subform SF3, for Order Item details during entry of Main form. Tab C only has one element, a subform SF4, for Order Item details during updates of Main form.
Want Tab C with subform SF3 to be invisible if Main form is @ADD, but visible when @UPDATE. Want Tab B with subform SF4 to be invisible if Main form is @UPDATE, but visible when @ADD.
------------- Tried to make the TabPage invisible: Tried Visibility(Tab A,1), Visibility(Tab B,0), did not work. Tried Visibility(Tab A,0), Visibility(Tab B,1), did not work. ------------ Since tabs cannot be invisible, then make the subforms invisible: Tried Visibility(SF3,1), Visibility(SF4,0), did not work. Tried Visibility(SF3,0), Visibility(SF4,1), did not work. --------------------- Ok, lets make the Tabs ReadOnly then: Tried ReadOnly(Tab A,1), ReadOnly(Tab B,0), did not work. Tried ReadOnly(Tab A,0), ReadOnly(Tab B,1), did not work. ----------- Since I could not make the TabPages ReadOnly, my fourth choice was to make the sub forms ReadOnly Tried ReadOnly(SF3,1), ReadOnly(SF4,0), did not work. Tried ReadOnly(SF3,0), ReadOnly(SF4,1), did not work. --------------------------------------------------------- All of these attempts are in the programming section of the Main form, On Form Entry. All references to the subform were to the element name bound to the subform, not to the subform name.
============================= The original plan was to have both SF3 and SF4 in same position on Tab B, and toggle visibility of the subform based on @ADD/@UPDATE, no need for Tab C. When this appeared not to work, I then created Tab C and moved SF4 from Tab B to Tab C, to toggle the TabPages vs. the forms. The original plan is still my preferred choice. -------------- My next attempt will probably be to make a GlobalValue that toggles when Main form is @Add/@UPDATE. Then I will have the programming in the sub forms SF3/4 check condition of Global Value and make every element invisible or ReadOnly.
(I have also thought of changing colors to make background and foreground same color, but that is only a trick to the eyes,. Cusrsor could still go into "hidden" elements and data could be changed/deleted/added).
But I am hoping I have been working on this for too long and have missed the obvious.
The goal: Have two (or more) subforms in same physical position on a Tab Page and have only one visible based on Main form mode of @ADD/@UPDATE. ---------- Hmmmm, I never did make both the Tab and the sub form on that page both invisible at the same time. I just tried the Tab alone first, and it did not work. Then I did the sub form alone, but not the Tab, and it did not work. Wonder if I need to do both the Tab and the subform? Will have to try that tomorrow.
Suggestions are welcome and encouraged. Thanks for your ideas.
|