Ask a questionAsk a question
 

AnswerGrid is blank

  • Friday, November 06, 2009 12:24 PMRavindraPatil Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Dear friends,
    I have a form with a data grid. The grid's recordsource is temp.dbf. In design mode the grid looks as I want it to display at run time. 
    But when the form is run, the grid becomes completley blank.
    I think it hapens, because I have used following statement in grid's init event.
    select * from vw_employee into table temp
    any solution to this?

Answers

  • Friday, November 06, 2009 3:26 PMtomcrux Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,
    take care about RecordSource property.

    When you create the table temp the value of grid's recordsource property have to be empty.

    Add these lines to Form's Init method

    * Before create the table
    MyForm.MyGrid1.RecordSource ='""

    * Get the table
    Select * from MyTable into table Temp

    * After create the table
    MyForm.MyGrid1.RecordSource ="Temp"

    Do this all the time when you create the Temp table, other way the grid becomes blank.

    Regards.

    Tom Cruz
    Córdoba,Argentina

    -----------------------------------------------------------------------
    "You shall know The Truth - and The Truth shall set you free"


    • Marked As Answer byRavindraPatil Saturday, November 07, 2009 11:01 AM
    •  

All Replies

  • Friday, November 06, 2009 12:59 PMdni Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You may try to do SELECT first, then use thisform.RecordSource = ..., thisform.RecordSourceType....
    dni
  • Friday, November 06, 2009 1:02 PMKalpesh Chhatrala Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    you can add below line into init event

    select * from vw_employee into table temp

    thisform.grid1.RecordSourceType= 0 
    thisform.grid1.RecordSource="temp"


    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
  • Friday, November 06, 2009 1:05 PMKalpesh Chhatrala Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi dni..

    your synatx may be wrong..

    there is no property available like "thisform.recordsource" and "thisform.recordsourcetype"

    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
  • Friday, November 06, 2009 3:26 PMtomcrux Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,
    take care about RecordSource property.

    When you create the table temp the value of grid's recordsource property have to be empty.

    Add these lines to Form's Init method

    * Before create the table
    MyForm.MyGrid1.RecordSource ='""

    * Get the table
    Select * from MyTable into table Temp

    * After create the table
    MyForm.MyGrid1.RecordSource ="Temp"

    Do this all the time when you create the Temp table, other way the grid becomes blank.

    Regards.

    Tom Cruz
    Córdoba,Argentina

    -----------------------------------------------------------------------
    "You shall know The Truth - and The Truth shall set you free"


    • Marked As Answer byRavindraPatil Saturday, November 07, 2009 11:01 AM
    •  
  • Tuesday, November 10, 2009 4:22 AMNaom Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Check "Safe Select" approach described in this blog http://weblogs.foxite.com/andykramek/archive/2005/03/19/174.aspx
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog