Tabbing Out Of Field In Form Header And Into Field In Detail?

P

PeteCresswell

Data entry form.

In the Form_Header, there's a dropdown where the user selects
accounts. Every time they select an account, a new row for the
selected account appears in the Detail section.

When the user is done choosing accounts (and tabs out of the combo
box) the assumption is that they want to go down to the account list
and start filling in an amount for each account.

Is there an MS Access UI-based way to do this, or do I have to put
code in the Exit event of the field in the form's header to .Setfocus
on the detail field?
 
P

PeteCresswell

I usually place the .SetFocus in the last tabbed field or in your case the
After_Update event of the combo box.

Thanks for confirming that VBA is a reasonable approach.

I want my guys to be able to choose multiple things from the dropdown,
so I went with KeyDown.

Viz:
-----------------------------------------------------------
Private Sub cboTradingAccountNumber_KeyDown(KeyCode As Integer, Shift
As Integer)
DebugStackPush Me.Name & ": cboTradingAccountNumber_KeyDown"
On Error GoTo cboTradingAccountNumber_KeyDown_err

' PURPOSE: To allow user to tab into txtAllocationAmount in the detail
section
'
' NOTES: 1) Tabbing between sections does not seem tb supported by
the MS Access UI

If ((Chr$(KeyCode) = vbTab) And (Shift = False)) Then
Me.txtAllocationAmount.SetFocus
' Stub "Greetings Pilgrim"
End If

cboTradingAccountNumber_KeyDown_xit:
DebugStackPop
On Error Resume Next
Exit Sub

cboTradingAccountNumber_KeyDown_err:
BugAlert True, ""
Resume cboTradingAccountNumber_KeyDown_xit
End Sub
-----------------------------------------------------------
 
G

Gina Whipp

Pete,

Your welcome... Thanks for posting your solution, chances are it will
assist someone else.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I usually place the .SetFocus in the last tabbed field or in your case the
After_Update event of the combo box.

Thanks for confirming that VBA is a reasonable approach.

I want my guys to be able to choose multiple things from the dropdown,
so I went with KeyDown.

Viz:
-----------------------------------------------------------
Private Sub cboTradingAccountNumber_KeyDown(KeyCode As Integer, Shift
As Integer)
DebugStackPush Me.Name & ": cboTradingAccountNumber_KeyDown"
On Error GoTo cboTradingAccountNumber_KeyDown_err

' PURPOSE: To allow user to tab into txtAllocationAmount in the detail
section
'
' NOTES: 1) Tabbing between sections does not seem tb supported by
the MS Access UI

If ((Chr$(KeyCode) = vbTab) And (Shift = False)) Then
Me.txtAllocationAmount.SetFocus
' Stub "Greetings Pilgrim"
End If

cboTradingAccountNumber_KeyDown_xit:
DebugStackPop
On Error Resume Next
Exit Sub

cboTradingAccountNumber_KeyDown_err:
BugAlert True, ""
Resume cboTradingAccountNumber_KeyDown_xit
End Sub
-----------------------------------------------------------
 

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

Top