How to display a text field of numbers as text?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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"
 
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.
 
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.
 
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,

Me feels dumb. Thanks. I had the wrong bounc column.
--
Brian


KARL DEWEY said:
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
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

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[/QUOTE][/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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top