Hello all!
I have a flexgrid and everytime a user would click in a cell to edit it, an error occurs
"Run time error 5 "Invalid procedure call or argument""
Here is my code:
'simple sub routine to fake the edits
Private Sub EditFlexGridCell(PassedText As String, Optional CpBoard As Boolean)
EditingCell = True 'set a global notifier that we are editing a cell
With txtEdit 'with the txtedit textbox, do the following
'first set the undotext to the current grid position's text in case
'the user hits escape or doesn't change it
UndoText = CheckFlexGrid.TextMatrix(CheckFlexGrid.Row, CheckFlexGrid.Col)
If PassedText = "" Then 'see if any text was incoming like from the clipboard
.Text = CheckFlexGrid.Text
.SelStart = 0
.SelLength = Len(.Text) 'highlight the text in the cell
ElseIf PassedText = "DEL" Then 'if the user pressed delete, then erase the text
.Text = ""
Else
.Text = PassedText 'if text was coming from the clipboard, stick it in here now
If CpBoard = True Then
.SelStart = Len(.Text) 'highlight it too
Else
.SelStart = 1
End If
End If
.SetFocus (where the error occurs)
'set the focus to the textbox so if the user enters text, it shows up in the textbox
End With
End Sub
Thanks!!!