hi,

i am making receipt entry for my live project.i will use MSFlexGrid to get input against Invoice numbers.

so venever last column has focus and if i press <enter>

=>if text12 and text13 value are equal, text14 will hav focus. Else u'll get Msgbox so that u can add one more rows for ur flexgrid.

VB Code:
  1. ElseIf KeyAscii = 13 And .Col = .Cols - 1 And .Row = .Rows - 1 Then
  2. If Val(Text12.Text) = Val(Text13.Text) Then
  3. Text14.SetFocus
  4. Else
  5. aa = MsgBox("Do you want to continue", vbYesNo + vbInformation, "Project1")
  6. Call amtcal
  7. i = .Row
  8. If aa = vbYes Then
  9. If gridblank(CInt(i)) = 1 Then Exit Sub
  10. .Rows = .Rows + 1
  11. .Row = .Row + 1
  12. .TextMatrix(.Row, 0) = Val(.Rows - 1)
  13. .Col = 1
  14. .SetFocus
  15. Else
  16. If gridblank(CInt(i)) = 1 Then Exit Sub
  17. Call amtcal
  18. SendKeys "+{end}"
  19. Text14.SetFocus
  20. End If
  21. End If
  22. End If

in order to edit its content, i am able to view all contents in the grid. bt if i decrease the amount in amount column, i must get msgbox again, bt it moves directly to the text14 without promptin msgbox of adding a new row.

i used the same coding as i did for Adding new receipt.

also ill b using different text boxes in the invisble mode, while giving input.

so hw am i to move in grid bt.columns, so that i get another row if the amount gets decreased????