How to get index of new entered sorted combo box item

LjushaMisha

Registered User.
Local time
Today, 14:03
Joined
Mar 10, 2017
Messages
81
Hello. First time on any forum. I'm not exactly Access user begginer, recently I've started using SQL and some VBA coding. Here is my problem which I'm dealing with for last month.

With NotInList event I'd like to add "new item" to combo box and select it programmaticaly like [Forms]![frmform2]![cboCombo0].Selected(n) = true. Where n should be the index of last entered item. I have resolved the problem until combo is sorted on unbound column.

As I need the combo to be sorted (unbound column are Last names, so I'd like to have them sorted ascending) and the last entered item gets "to me unknown" index I need some help on this metter.

Or maybe in other words:

Instead of [Forms]![frmform2]![cboCombo0].Selected(3) = true to have it in some way like [Forms]![frmform2]![cboCombo0].Selected("joe") = true.

Any help possible, PLEASE
 
rather than using the index, use the value

[Forms]![frmform2]![cboCombo0]= "joe"

Assuming Joe is the value in the bound column
 
No. "Joe" is unbound column. ID of "Joe" is bounded
 
in that case

[Forms]![frmform2]![cboCombo0]= ID

Where ID is the ID for Joe
 
I think Ihave resolved the problem. You helped me to find out that I don't need indexes. I've used "syntax" like follows
Combo0=i where i (as integer) =DMax("[ID]", "tblNames")

Thanks to all for help:)
 

Users who are viewing this thread

Back
Top Bottom