Refreshing subform

david.weeksdavid.weeks Member Posts: 96
edited 2004-05-16 in Navision Attain
Hello All

I have a form with a button and a subform with a table box.
When pressing the button in the main form, i want to automatically update the subform with the added information.

I have tried to use currform."subform".UPDATE but i receive a message that says i cannot do this.

Any alternative?

Comments

  • wonmowonmo Member Posts: 139
    What do you mean by "update" (ie. insert or modify?). What tables are the form and subform accessing?
  • david.weeksdavid.weeks Member Posts: 96
    Hi there,

    When I say "update", I mean, when the button is pressed on the header of the form - (this is a new form not based on any table), it will insert records into a new table I have created (based on what the user inputs/selects etc).

    When the insert is complete, I want the subform to be automatically updated (the subform is based on the table) and show the records that have just been inserted.

    Any ideas would be great.....
  • wonmowonmo Member Posts: 139
    Is the user inserting values into variable fields then? If so then you will have to assign the variable values to a variable of type record representing the table from the subform.

    Out of curiosity, why are you using a subform if the main form is not linked to a table? All this would be much easier to manipulate if the main form were linked to the subform table.
  • RobertMoRobertMo Member Posts: 484
    If you are really dealing with the same table that you are showing, you can set your table as base on the main form and use Tablebox instead of Subform.
    You can still make TableBox non-editable and use variables to present user an input/selection.
    To make it easier for you to copy your variables into your record use record variable instead using one variable for a each field.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • AlterantAlterant Member Posts: 19
    Hi, I've met with same problem ... and have found solution (quite simple :lol:).

    In the subform make a procedure "UpdateRecords" with only one line of code:
    UPDATE;

    In the main form when you need to update the subform call this procedure like below:
    CurrForm.SubForm.FORM.UpdateRecords;

    That's it. You'll have the subform updated.
Sign In or Register to comment.