Grid is blank
- 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
- 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
- You may try to do SELECT first, then use thisform.RecordSource = ..., thisform.RecordSourceType....
dni - you can add below line into init eventselect * from vw_employee into table tempthisform.grid1.RecordSourceType= 0thisform.grid1.RecordSource="temp"
Please "Mark as Answer" if this post answered your question. :)
Kalpesh Chhatrala | Software Developer | Rajkot | India
Kalpesh's Blog - 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 - 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
- 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


