Temporary table on a form

Hi I have a temporary table, that shoul be displayed on a form - I can make it work through use of this: FORM.RUN(formnumber,temprec); but that isn’t sufficient for my use! I want to change the caption on the form, depending on which data there are in the temp.table. Therefore I would use this code: F.CAPTION := ‘New FormCaption’; F.SETTABLEVIEW(TempRec); F.SETRECORD(TempRec); F.RUN; But this will show all the records in the “real” table and not only those in the temp. table??? Jens

Jens, your initial approach is correct, when working with temporary records. Rather than assigning the new Caption from the point where you call the form, you should create a new function within that form that returns the Caption String. If I remember well, have a look at the Comment Form of the Human Resource module, there you can find an example. Saludos Nils

In OnOpenForm trigger just add the code you need to get your new caption: Example: FILTERGROUP(2); CurrForm.CAPTION := GETFILTER(Field2); FILTERGROUP(0); or CASE GETFILTER(Field2) OF ‘A’: CurrForm.CAPTION := 'New FormCaption; ‘B’: CurrForm.CAPTION := 'Another FormCaption; END;

Also - Take a look into The Navigate form (I belive it’s 344) Look at the code on the triggers of the form - it uses a temporary table also. I have use the concepts from it many times…

Hi Jens, whilst its most common to craete a form based on a normal record, and then use code to substitute values from a temporary table. There is a much simpler solution. Basically you wirte code that passes the temporary record as a VAR paramater to a normal form, and thats it. I have uploaded a simple example that will get you started. http://www.mbsonline.org/forum/file_library.asp?showmethefile=40&thatcat=14&thiscat=Member%2Dto%2DMember+Samples+and+Software