Combo Box Move To Next After Save

jwood29

Registered User.
Local time
Yesterday, 17:41
Joined
May 13, 2008
Messages
28
I have Category Combo Box with:
"Professional Dev"
"Quality"
"Quantity"
"Appearance"
"Time Managment"


I would like to have my category combo box move down to next one in list after clicking Save button.

Can someone get me in right direction for code on this.

Thanks in advance.

jwood29
 
You don't say what you want to happen after you reach the final item in the combobox and the user clicks the "Save" button, but this does what you want and after "Save" is clicked on the last item moves the combobox back to the first item again:

Code:
Private Sub SaveButton_Click()
If ComboBox.ListIndex <> -1 And ComboBox.ListIndex <> ComboBox.ListCount - 1 Then
  ComboBox.SetFocus
  ComboBox.ListIndex = ComboBox.ListIndex + 1
Else
  ComboBox.SetFocus
  ComboBox.ListIndex = 0
End If
End Sub

To set the combobox to no selection after last item is saved replace

ComboBox.SetFocus
ComboBox.ListIndex = 0

with

ComboBox = Null
 
I'm not sure I can use that code. as I am using embedded macro built from the command button wizard (I chose Add New Record option).

If I choose event procedure to put the code on click event, then it removes the macro to save. Any suggestions? thanks.
 

Users who are viewing this thread

Back
Top Bottom