tabbing in form

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

Hi,
I have a form with 5 fields.

When the user is in edit mode i want him to go through the fields
in order 1,2,3,4,5.


When the user is in append mode,
i want him to enter field 4, field 5, then get a new record
then field 4, field 5, new record,...

I dont want the cursor to go in field 1,2,3 which will be filled
automatically in append mode.

How can i do that ?

Is there a way or a property to know that we are in append mode?
 
By append, if you mean adding a record. you can test for Me.NewRecord in
Form_Current.

If Me.Newrecord then
Me.field1.Tabstop = False
Me.field2.Tabstop = False
Me.field3.Tabstop = False
Else
Me.field1.Tabstop = True
Me.field2.Tabstop = True
Me.field3.Tabstop = True
End If

Debbie

| Hi,
| I have a form with 5 fields.
|
| When the user is in edit mode i want him to go through the fields
| in order 1,2,3,4,5.
|
|
| When the user is in append mode,
| i want him to enter field 4, field 5, then get a new record
| then field 4, field 5, new record,...
|
| I dont want the cursor to go in field 1,2,3 which will be filled
| automatically in append mode.
|
| How can i do that ?
|
| Is there a way or a property to know that we are in append mode?
|
 
Untested, but try setting the TabStop of the controls in the Current event
of the form:

Private Sub Form_Current()
Dim bOldRec As Boolean

bOldRec = Not Me.NewRecord
Me.[Field1].TabStop = bOldRec
Me.[Field2].TabStop = bOldRec
Me.[Field2].TabStop = bOldRec

If Not bOldRec Then
Me.[Field4].SetFocus
End If
End Sub
 
Back
Top