We help IT Professionals succeed at work.

MS ACCESS

Michael Thomas
on
I receive this error when I am trying to select an item from a multi-column List Box.
"The value you entered isn't valid for this field"

I am not trying to insert anything into a field.
Comment
Watch Question

Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
Is there any code behind that control?
Michael ThomasProgrammer

Author

Commented:
No it was created from a query and I have no formatting other than column sizing.  I am using Window 10 Client with Access 2007-2016 and the tables are linked SQL Server tables.
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
The listbox bound column is a PK field?
Michael ThomasProgrammer

Author

Commented:
The Bound Column is set to 1.  The first field in the select statement is the PK for the SQL Server table that is being used to build the multi-column List Box.
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
I was able to replicate the issue by having a Control Source of a different data type than that of the Bound Row Source column.  So check your Control Source and Row Source to ensure they are the same data type.  Since your listbox is providing a PK value (probably autonumber) then the Control Source column should also be a Number field to accept the value properly.
Michael ThomasProgrammer

Author

Commented:
Control Source was blank.  Row Source contained the SQL query.
Top Expert 2014
Commented:
try binding to column 0.  Multi-column listbox columns are zero origin
Michael ThomasProgrammer

Author

Commented:
Thank you both.