Tab order different when adding -v- editing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have posted this before in Forms Design but no luck so am trying here...
I would like to have the tab order for controls on a form different when
entering in Add mode, as opposed to when going into it in Edit mode.
Is this possible?
Thanks
CW
 
It could be done with Visual Basic, or you could just have a different
version of the form.
 
Yes, you have to find a suitable event for it to work but it essentially
comes down to

Private Sub Command8_Click()
With Me
.Text0.TabIndex = 4
.Text1.TabIndex = 3
.Text2.TabIndex = 2
.Text3.TabIndex = 1
End With
End Sub

Private Sub Command9_Click()
With Me
.Text3.TabIndex = 4
.Text2.TabIndex = 3
.Text1.TabIndex = 2
.Text0.TabIndex = 1
End With
End Sub

NOTE
 
I haven't done this but most (but not all) Controls have 2 Properties:
TabStop (Boolean) and TabIndex (Integer). Since both are read/write
properties, you can change the order of tabbing by changing the TabIndex of
each Control and whether the Control is included in the tabbing sequence.

Check Access VB Help on these Properties. There are sample codes in Help
also.
 
CW,

Use the On Current Event

Private Sub Form_Current()


If Me.Form.NewRecord Then
Form("Field1").TabIndex = ?
Form("Field2").TabIndex = ?
Form("Field3").TabIndex = ?
Form("Field4").TabIndex = ?

Else
Form("Field1").TabIndex = ?
Form("Field2").TabIndex = ?
Form("Field3").TabIndex = ?
Form("Field4").TabIndex = ?
End If

End Sub
 
Thanks to all for the various solutions - I'll see which one works best for me!
10-Q
CW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top