Textbox Values Disappearing

Jonathan2708Jonathan2708 Member Posts: 552
Hi,

I have a form with a tab control. The form has a source table of TableA. On tab page 1 there is a tablebox linked to TableA. On tab page 2 there is a subform containing a tablebox linked to TableB.

The form also has 2 text boxes each with a source expression linked to a global variable. In code the global variables are set to the COUNT of records in TableA and TableB.

Everything works fine except when the records in TableA get emptied in code. When this happens the values in the 2 text boxes disappear, until the user clicks on tab page 2 when they re-appear. Click on tab page 1 and they disappear again.

Is there some requirement that a tablebox bound to the parent form must have at least one record in it for text boxes to display their values?

Any help appreciated,

Jonathan

Comments

  • Ravi_Prakash_GoyalRavi_Prakash_Goyal Member Posts: 72
    I have tried your case but it is working fine. Initially I have 3 records in Table A and textbox also displaying 3. when i deleted 2 records it was showing 1 record. I have written the code on Form - OnAfterGetRecord() for counting the records.
    If textbox is on the form (i.e. parent ID is Form) then changing from one tab to another tab does not make any difference.
  • Jonathan2708Jonathan2708 Member Posts: 552
    Hi thanks for having a look at this. I stuck at it and have sorted it out - it was to do with form refreshing and the few tricks you have to pull when using subforms.

    I have found that when using subforms, if you do a CurrForm.UPDATE against the parent form it doesn't always work properly unless the focus is on a control on the main form.

    Jonathan
Sign In or Register to comment.