Index: frm/frmEditGrid.cpp
===================================================================
--- frm/frmEditGrid.cpp	(revision 8296)
+++ frm/frmEditGrid.cpp	(working copy)
@@ -481,6 +481,9 @@
     int curcol=sqlGrid->GetGridCursorCol();
     int currow=sqlGrid->GetGridCursorRow();
     
+    if (curcol == -1 || currow == -1)
+        return;
+    
     sqlTable *table=sqlGrid->GetTable();
     wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
     wxString new_filter_string;
@@ -522,6 +525,9 @@
 {
     int curcol=sqlGrid->GetGridCursorCol();
     int currow=sqlGrid->GetGridCursorRow();
+
+    if (curcol == -1 || currow == -1)
+        return;
     
     sqlTable *table=sqlGrid->GetTable();
     wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
@@ -571,6 +577,9 @@
 {
     int curcol=sqlGrid->GetGridCursorCol();
     
+    if (curcol == -1)
+        return;
+
     sqlTable *table=sqlGrid->GetTable();
     wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
     wxString old_sort_string = GetSortCols().Trim();
@@ -608,6 +617,9 @@
 {
     int curcol=sqlGrid->GetGridCursorCol();
     
+    if (curcol == -1)
+        return;
+    
     sqlTable *table=sqlGrid->GetTable();
     wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
     wxString old_sort_string = GetSortCols().Trim();
@@ -761,6 +773,10 @@
 {
     int curcol=sqlGrid->GetGridCursorCol();
     int currow=sqlGrid->GetGridCursorRow();
+
+    if (curcol == -1 || currow == -1)
+        return;
+
     int keycode=event.GetKeyCode();
     wxCommandEvent ev;
 
