-
Hi!
I want the user of my app to be able to enter data in fields the same way as in excel or in access. What is the best (easiest) control to use? (No third party controls please). The data must be at leat 4 "columns" wide (I prefer somthing to be expandble to 5 or more columns). Some columns will contain text, other numeric-values. (Although they could be converted by Val() or so...)
Here are my considerations so far:
- The Listview?
(Can't edit more than first column?) - DBGrid?
(Too Complex) - Lots of textboxes in an array?
(Too Complex, can be done easier I think) - Excel/Access Add-in?
(Too heavy on resources)
Anyone any good ideas?
-
-
Try the Grid from vbaccelerator.com, it's pretty easy to use and has a lot of configurable options. You can edit stuff too, it uses some depencies, but it looks really good!
ps: jij bent toch ook nederlands?
-
JOP:
Thanx for the reply, though I don't like to use 3rd party controls. Any other ideas? It doesn't have to be connected to a DB.
(Ja, ik ben ook nederlands ;) Engels is alleen makkelijker hiero ;) Maar wel bedankt voor de reactie! )
-
Does anyone know how to do this?
-
I picked this up somewhere a long time ago and it will allow you to edit the MSFlexGrid. Maybe it will help you get a start.
Code:
Private Sub MSFlexGrid_KeyPress(KeyAscii As Integer)
With MSFlexGrid
Select Case KeyAscii
Case 8: 'IF KEY IS BACKSPACE THEN
If .Text <> "" Then .Text = Left$(.Text, (Len(.Text) - 1))
Case 13: 'IF KEY IS ENTER THEN
Select Case .Col
Case Is < (.Cols - 1):
SendKeys "{right}"
Case (.Cols - 1):
If (.Row + 1) = .Rows Then
.Rows = .Rows + 1
End If
SendKeys "{home}" + "{down}"
End Select
Case Else
.Text = .Text + Chr$(KeyAscii)
'write your own keyascii Validations under
'commented lines
Select Case .Col
Case 0, 1:
'if (your condition(s)) then accept only charectors
'Else
' keyascii=0
'End If
Case Else :
End Select
End Select
End With
End Sub
-
Want to do it to Listview, not Flexgrid.
-
It would probably be better to start your own thread
rather than dredging up 4 year old ones.
You can then specify cleary what you want to do.