Deleted this twice, due to wrapping / messing-up . . .
Thanks to all who have e-mailed suggestions about my Grid-Grief.
The following "cheat" eliminated my grief over trying to "Point"
the RecordSelector (TrueDBGrid) at the newly added row/record :
(Writing something into the 1st cell of the new row...!)
-----------------------------------------------------------------------
Private Sub cmdAdd_Click() 'This adds a row, and automatically
Dim Z 'assigns Job# to the JobID field .
Dim DB As Database, RS As Recordset
On Error Resume Next
Set DB = OpenDatabase("C:\CostTrak\CostTrak.mdb")
Set RS = DB.OpenRecordset("Mobe")
DB.OpenRecordset ("Mobe")
RS.AddNew
RS.Fields("JobID") = EditJobNum$
RS.Update
datPrimaryRS.Refresh
grdDataGrid.Refresh ' Now, find out ...
Z = grdDataGrid.VisibleRows ' How Many rows ??
grdDataGrid.Col = 1 ' Cell 'Location' now;
grdDataGrid.Row = Z - 2 ' (ignore fixed...)
grdDataGrid.EditActive = True ' "Focus"
grdDataGrid.Text = "[Enter] or [Delete]" ' "OK"-Text won't save
End Sub ' to this field (Currency)!
-----------------------------------------------------------------------
Now, my tutorial (Help) explains to the <"computer-illiterate"> users
that after they [Add] a Row/Record , and see this message . . .
"[Enter] or [Delete]" . . . it means that they are to either
begin entering data at "This Point", or click on the [Delete] command
button !
Of course, the "default" code for the {VB-Data-Aware-Form-Grid}
[Delete] command button left a bit to be desired ( not prompting the
user for verification before deleting ) . . . to wit , one should add :
-----------------------------------------------------------------------
Private Sub cmdDelete_Click()
Dim X
On Error Resume Next ' in case of .Delete "difficulty". . .
X = MsgBox("Are you sure you want to Delete this record ?", 1)
If X = 2 Then
Exit Sub
ElseIf X = 1 Then
With datPrimaryRS.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
End If
End Sub
----------------------------------------------------------------------