How to display a text field of numbers as text?

B

Brian

I have a table in which data are entered and categorized according to a cost
code, e.g., 14.2, 21, 14.2.6.4, etc. I created a combo box (I also tried a
text box) so the user can only enter in the correct cost codes. The data
type of the cost code is text because a number with multiple decimal points
will not work The problem is that when I run a query to gather records, the
resulting table does not conatin the text of the cost code but rather a
number of which I know not where it comes from. I tried format properties
indicating that a character is not needed but that did not work. What am I
doing wrong? Thanks
 
J

Jerry Whittle

Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here.

Also describe the Row Source for the Combo Box.

Lastly are you using Lookup fields at the table level? If you click into the
cost code field in the table, does a drop down show up? If so you just ran
into one of many reason to not use them. Below is a great list of reasons to
dump them.

http://www.mvps.org/access/lookupfields.htm
 
K

KARL DEWEY

The criteria needs to be text. You are probably omitting the quotes from the
criteria like this ---
14.2 should be entered as "14.2"
 
B

Brian

Jerry,

Please see answers below.

Thanks
--
Brian


Jerry Whittle said:
Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here.

SELECT [All Invoices].Vendor, [All Invoices].[Invoice #], [All
Invoices].Amount, [All Invoices].Code, [All Invoices].[Month invoice paid],
[All Invoices].[Sent to HSRC?] INTO [Invoice list to HSRC]
FROM [All Invoices]
WHERE ((([All Invoices].[Sent to HSRC?])=False));
Also describe the Row Source for the Combo Box.

SELECT [Current Codes].[ID], [Current Codes].
Code:
 FROM [Current Codes]
ORDER BY [Code];[QUOTE]
Lastly are you using Lookup fields at the table level? If you click into the
cost code field in the table, does a drop down show up? If so you just ran
into one of many reason to not use them. Below is a great list of reasons to
dump them.[/QUOTE]

Yes, it is a drop down.
 
B

Brian

Karl,

I do not have any cirteria for the code field because it does not matter
what code is there, I just want all the codes for those records not yet
processed.
 
K

KARL DEWEY

Maybe the numbers you are seeing are the [Current Codes].[ID].

Which column is Bound Column in the Combo box and what is the Control Source?
--
KARL DEWEY
Build a little - Test a little


Brian said:
Jerry,

Please see answers below.

Thanks
--
Brian


Jerry Whittle said:
Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here.

SELECT [All Invoices].Vendor, [All Invoices].[Invoice #], [All
Invoices].Amount, [All Invoices].Code, [All Invoices].[Month invoice paid],
[All Invoices].[Sent to HSRC?] INTO [Invoice list to HSRC]
FROM [All Invoices]
WHERE ((([All Invoices].[Sent to HSRC?])=False));
Also describe the Row Source for the Combo Box.

SELECT [Current Codes].[ID], [Current Codes].
Code:
 FROM [Current Codes]
ORDER BY [Code];[QUOTE]
Lastly are you using Lookup fields at the table level? If you click into the
cost code field in the table, does a drop down show up? If so you just ran
into one of many reason to not use them. Below is a great list of reasons to
dump them.[/QUOTE]

Yes, it is a drop down.[QUOTE]
http://www.mvps.org/access/lookupfields.htm[/QUOTE][/QUOTE]
 
Ö

Öлª·ÄÖ¯Íø--È«Çò×î´óÖÐÎÄ·ÄÖ¯ÀàÆ½Ì¨

ÄãÃÇÔÚÄÄÀï
KARL DEWEY said:
The criteria needs to be text. You are probably omitting the quotes from
the
criteria like this ---
14.2 should be entered as "14.2"
 
Top