Strange Subform

Hi All, I have a form with 3 Subforms. They all lie directly over each other (as in the main form 330). They all have the property visible set to false. Which subform is shown, depends on a field-value of actual record of the main form. This works fine, if i have a record an change the value of this field. The right subform is shown. But when i choose another record (page-up or page-down) sommetimes i see a black field where the subform should be shown. The Function which set the visible-properties of the subforms is called in the OnAfterGetRecord-Trigger. Can anyone tell me why no subform is shown, although the programmed code says that a subform should be shown??? Thanks in advance. Regards, Frank

Hi, If you select your record with the previous and next button , or with the search button , have you the same problem ?

Yes, i have the same problems [xx(]

quote:


Originally posted by FPulsfort
Yes, i have the same problems [xx(]


I don’t understand because to help you i’m creating a new form sourcetable T27, i’ve just put 3 subforms of the menu principal and so test in the third char of the item no. to show one subform and i have no problem. Here is the code. Do you see a thing that you have done ? and not me ? Form - OnOpenForm() CurrForm.ContMgtMenu.VISIBLE(FALSE); CurrForm.HumanMenu.VISIBLE(FALSE); CurrForm.FAMenu.VISIBLE(FALSE); Form - OnAfterGetRecord() CASE COPYSTR(“No.”,3,1) OF ‘1’ : BEGIN CurrForm.ContMgtMenu.VISIBLE(FALSE); CurrForm.HumanMenu.VISIBLE(FALSE); CurrForm.FAMenu.VISIBLE(TRUE); END; ‘2’ : BEGIN CurrForm.ContMgtMenu.VISIBLE(FALSE); CurrForm.HumanMenu.VISIBLE(TRUE); CurrForm.FAMenu.VISIBLE(FALSE); END; ‘3’ : BEGIN CurrForm.ContMgtMenu.VISIBLE(TRUE); CurrForm.HumanMenu.VISIBLE(FALSE); CurrForm.FAMenu.VISIBLE(FALSE); END; END;

First of all thanks for your repleys!!! There are only 2 Differences: a) In order to save code, i first set to all subform visible := false and then with a case the right one to visible := true. But this doesn’t matter. Both version do not work in my case. b) my subform are on a pageframe and not on the first page. And this page is not the active one during changing the record. Maybe this is the problem??? Greetings, Frank

I try it with tabcontrol and so no problem Have you try to put a currform.UPDATE ?

Sure, but this does not help [:(] Is the tab with your subform active or is there another tab visible while choosing another record?

quote:


Originally posted by FPulsfort
Sure, but this does not help [:(] Is the tab with your subform active or is there another tab visible while choosing another record?


Hi, I’m fine you answer because tomorrow i’m going on holidays So i would like to help you I have put a subform in each tab (3) And so when i change the record the subforms is correctely visible or not, but obviously the tab whis not activate, so if you want you can put a .ACTIVATE

Hi and thanks for your help, i have one tab, where all three subform lie over each other. I can’t make three tabs, one for each subform, because of the style of the form. The User should not change to another subform, which is not active. Wish you a happy holiday. I have to work another 3 days…and then…holiday!!! [8D] Regards, Frank

With on tab it is ok too, Can you send me your form ?

Have you tried moving the code on OnAfterGetRecord to the OnNextRecord trigger?

quote:


Originally posted by crandzfv
Have you tried moving the code on OnAfterGetRecord to the OnNextRecord trigger?


Hi, If you do that, the trigger doesn’t work well

You’re right, it does not work on OnNextRecord trigger. I tested on OnAfterRecord and it works well for me, too.