Public Sub ResizeGridX(pGrid As MSHFlexGrid, pForm As Form)
Dim intRow As Integer
Dim intCol As Integer
'for empty rows
Dim i As Integer
Dim j As Integer
Dim sSQL As String
With pGrid
For intCol = 0 To .Cols - 1
For intRow = 0 To .Rows - 1
If .ColWidth(intCol) < pForm.TextWidth(.TextMatrix(intRow, intCol)) + 100 Then
.ColWidth(intCol) = pForm.TextWidth(.TextMatrix(intRow, intCol)) + 100
End If
Next
Next
End With