Fill Form (table) with Dataport

gicifgicif Member Posts: 16
Hi everybody

i have a simply form based on a custom table with few fields. On the form is a button "Load Data": this run a dataport that load data into my cust table. This works fine: the table is correctly populated with my data. The problem is that the form still remain empty. Only when i call a refresh command by menu or pressing CTRL+ALT+F5, the form display me the data.
What happens?

I tried with COMMIT or CurrForm.UPDATE too, at the end of dataport run, but this don't work.

Please, can anyone help me?

Best regards

gicif

Comments

  • ArhontisArhontis Member Posts: 667
    Hello gicif and wellcome to mibuso,

    try doing in the OnPush finction of your button the following:

    DATAPORT.RUNMODAL(......);
    CurrForm.FIND('-');

    and you will be ok... I have tried it on an 4.0 SP3 version...

    Know that if you try DATAPORT.RUN, then the code below it doesn't wait for the dataport to finish and the execute the remaining code, but it continues executing the code after the dataport.run regardless you have executed the dataport.

    The runmodal causes the code to wait, and when the execution of the dataport is finished, it continues to the FIND('-') line of code...
  • gicifgicif Member Posts: 16
    Ok, this works great! :lol:

    Many thanks, Arhontis, for your precious support.

    gicif

    ps
    for your curiosity, i'm with 5.0 and CurrForm.FIND('-') isn't supported.
    It's enough the first statement DATAPORT.RUNMODAL..... and it's the key to solving my problem.
  • ArhontisArhontis Member Posts: 667
    Can you use FINDFIRST instead?

    Haven't worked on 5.0 yet... not in greece...
  • gicifgicif Member Posts: 16
    Yes, I tried FINDFIRST too, but it's not supported by CurrForm object.

    Many thanks again, Arhontis.

    Regards

    gicif
  • ArhontisArhontis Member Posts: 667
    no no no.... lol

    My mistake!!! wrong copy/paste lol...

    DATAPORT.RUNMODAL(......);
    Rec.FIND('-');
    or
    Rec.FINDFIRST;
    or just
    FINDFIRST;
    (the rec variable on a form can me omitted...)
Sign In or Register to comment.