Another test I select the combobox value "43", the msgbox showed "45" and "103" was sought. CarvingNR "43" has a primary key of "45". Why is the PK being returned as the as the combobox value selected?
Usually, the PK field is the bound column - but you can set the bound column to any column you wish.
If the row source is
Code:
SELECT[Carving Table].IDCarv, [Carving Table].CarvingNR FROM [Carving Table] ORDER BY [Carving Table].CarvingNR;
and the combo box has these settings
(on Data tab)
Bound column = 1
(on Format tab)
Column count = 2
Column widths = 0";1 (this sets the first field, "IDCarv", to not visible and the 2nd field, "CarvingNR", to visible)
Then the "IDCarv" (PK?) is being returned.
Try adding this line to the code:
Code:
MsgBox "IDCarv value = " & Me.Select_CrNr & newline & newline & "CarvingNR value = " & Me.Select_CrNr.Column(1)
Note the code in red.