Urgent - need help with defult values

Hi all! I need some help on adding default values to a subform. I am using sales invoice form 43 and subform 47(kopies of cource), and I would like to add default values to the subform when a new invoice is made. Where do I add the code? I tried to add the code: evaluate (type,startoption) in OnActivateForm and OnNewRecord in the subform-didn’t work… Does anyone know how to do this? Tia,

Well it works for me in OnNewRecord! This is where rec.Type is set in form 47 for example. Have you done something else you have not mentioned? I have tried Type := xRec.Type; //standard code CLEAR(ShortcutDimCode); //standard code Type:=mytype::Resource; // my code and this always forces the type = resource.

Thanks for your reply, but it doesn’t work… What am I doing wrong? No other changes are made… Bjarte

Have you tried putting code into the table. I find it best when managing data to use table triggers.

Hi Jonathan, I have thought about doingt just that, but I don’t want the default values in other forms which uses this table. Regards, Bjarte

Maybe just a heretical question: you wrote that you are using copies of the original forms. Did you make sure that the subform in the copied main form is re-directed to the correct (the copied) subform? [;)]

quote:

Hi all! I need some help on adding default values to a subform. I am using sales invoice form 43 and subform 47(kopies of cource), and I would like to add default values to the subform when a new invoice is made. Where do I add the code? I tried to add the code: evaluate (type,startoption) in OnActivateForm and OnNewRecord in the subform-didn’t work… Does anyone know how to do this? Tia,
Originally posted by bjarte - 2005 May 04 : 09:59:51

Try putting You code in the OnNewRecord trigger.