Access; Error Message on form fro ComboBox

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,332
Office Version
  1. 365
Platform
  1. Windows
Error: "The value you entered isn't valid for this field"

The combo box, where I get this message, is a bound field to a table.

The Field on the table is tied to an ODBC table. In the Data Type, for this field, I used the Lookup Wizard to create the list. But what is happening is that the Data Type turns into "Number" after I identify the fields for the list.... using the wizard. The data that's in the Combo Box list isn't a Number, its text.


So when I use the combo box on the form and make a selection from the list, I get the message listed above. It will not let me enter what I select from the combo.

I assume its because the Data type is Number and the actual data is Text (my assumption).

How do I fix this or get around it. I have used the wizard before where it identified the data type as short text, but here it keeps identifying it as a Number.

FYI
Row Source: SELECT [ModelGeneral_vluItem].[ItemID], [ModelGeneral_vluItem].[ItemDescription], [ModelGeneral_vluItem].[ItemRevisionID], [ModelGeneral_vluItem].[Commodity] FROM ModelGeneral_vluItem ORDER BY [ItemID];

Help Please!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Not sure what field you are dealing with. It should probably be cast to a string.

for instance,
RowSource:
SELECT [ModelGeneral_vluItem].[ItemID], [ModelGeneral_vluItem].[ItemDescription], [ModelGeneral_vluItem].[ItemRevisionID], CStr([ModelGeneral_vluItem].[Commodity]) as Exp1 FROM ModelGeneral_vluItem ORDER BY [ItemID];
 
Upvote 0
can you elaborate? what is this doing by adding The CStr? what I am looking for is the ItemID to be populated in the combo box after the selection. That's my bound column.
 
Upvote 0
CStr() converts a number (or any value you give it, really) to a string. You said you need a text data type for some field. So that's how you would ensure that all values in that field are Text.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top