Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeating Panel messes up calculated fields

Status
Not open for further replies.

itsecsol

Programmer
Dec 31, 2001
9
US
I'm adding to a SmartSuite 9.5 Approach database and found some strange behavior. The view contains several checkboxes which are iterated through to calculate a value times the number of checkboxes.

Everything works fine until I add a repeating panel. I even eliminated the iteration to just test one box and it still behaves strangely.

Can anyone help me figure out what's going on?

Details:
In CheckBox1's Change event, I have:
CurrentView.Body.ReExam_Fees.text = (-(CurrentView.Body.chkReExam1.IsChecked + CurrentView.Body.chkReExam2.IsChecked))*70

What Happens:
I Browse the form with CheckBox1 & 2 unchecked. If I check CheckBox1, the ReExam_Fees still shows 0. When I UNcheck it, the ReExam_Fees changes to 70! When I set this event for CheckBox2, the same the would happen. Also tried this on MouseUp event. It's as if the calculated value is 1 step behind the actual checkboxes.

Strangely, even when using it as MouseUp event, the values change AFTER I click the mouse button down, not after I release it.

Please help! Thank you.
 
Problem with the Change event in Approach controls is that it doesn't fire until the change is committed; ie Enter is pressed or focus is lost from the control. If only the mouse is used, try using the Click event instead of Change but this won't fire if the state is changed by pressing the spacebar when the checkbox has focus.

Mouse Up/Move/Down are designed to be used together for dragging operations where the user can resize controls at run-time. They don't work properly and Approach controls don't expose a property to change the mouse cursor when it's over a control so they are totally useless.

Paul Bent
Northwind IT Systems
 
Check to see if the Change event is actually firing by putting a "Beep" statement at the beginning of the sub.
If you find the event fires correctly then you need to temporarily change the focus to some other object in order for Approach to set the field properly (an Approach quirk). To reduce screen flicker I like to set focus to an object that has a SetFocus method but cannot actually recieve focus (such as a line object). Example:

CurrentView.Body.objLineObject.SetFocus

CurrentView.Body.ReExam_Fees.text = (-(CurrentView.Body.chkReExam1.IsChecked + CurrentView.Body.chkReExam2.IsChecked))*70

Regards,

Keith Seeley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top