Index: pgadmin/include/gqb/gqbViewController.h
===================================================================
--- pgadmin/include/gqb/gqbViewController.h	(révision 8008)
+++ pgadmin/include/gqb/gqbViewController.h	(copie de travail)
@@ -88,6 +88,7 @@
     void emptyModel();
     void calcGridColsSizes();
     gqbQueryRestriction* addRestriction();
+    int getTableCount(){return model->tablesCount();};
 
 protected:
     gqbView *view;						// owned by caller application shouldn't be destroy by this class
Index: pgadmin/frm/frmQuery.cpp
===================================================================
--- pgadmin/frm/frmQuery.cpp	(révision 8008)
+++ pgadmin/frm/frmQuery.cpp	(copie de travail)
@@ -1814,7 +1814,10 @@
     // If the new query is empty, don't do anything
     if (newQuery.IsEmpty())
     {
-        wxMessageBox(_("No SQL query was generated."), wxT("Graphical Query Builder"), wxICON_INFORMATION);
+        if (controller->getTableCount() > 0)
+        {
+            wxMessageBox(_("No SQL query was generated."), wxT("Graphical Query Builder"), wxICON_INFORMATION);
+        }
         gqbUpdateRunning = false;
         return false;
     }
