INSERT A DASH IN A TABLE LISTING PART#'S

  • Thread starter Thread starter KEVTERS JOY
  • Start date Start date
K

KEVTERS JOY

I have a table of part#'s such as CT11111111 and I need to change the part#'s
to read CT1111-1111, the parts need to all be formated the same so it is CT
then 4 #'s, a dash, and 4 #'s. How do I get Access to do this? Do I run an
update query, key an expression? I have tried to search this out on my own
but can't find anything on it.
 
BACKUP DATABASE -------- BACKUP DATABASE
Assuming that the part numbers all are loaded with the same number of digits
and you want to place the dash before the last four digits, use an update
query.
The Update To of the query design view grid below your field would look like
this --
Left([YourFieldName], Len([YourFieldName])-4) & "-" &
Right([YourFieldName], 4)
 
Thank you so much! I have been racking my brain over this. I just ran it and
it works. Thanks again! :-)



KARL DEWEY said:
BACKUP DATABASE -------- BACKUP DATABASE
Assuming that the part numbers all are loaded with the same number of digits
and you want to place the dash before the last four digits, use an update
query.
The Update To of the query design view grid below your field would look like
this --
Left([YourFieldName], Len([YourFieldName])-4) & "-" &
Right([YourFieldName], 4)

KEVTERS JOY said:
I have a table of part#'s such as CT11111111 and I need to change the part#'s
to read CT1111-1111, the parts need to all be formated the same so it is CT
then 4 #'s, a dash, and 4 #'s. How do I get Access to do this? Do I run an
update query, key an expression? I have tried to search this out on my own
but can't find anything on it.
 
KEVTERS JOY said:
I have a table of part#'s such as CT11111111 and I need to change the part#'s
to read CT1111-1111, the parts need to all be formated the same so it is CT
then 4 #'s, a dash, and 4 #'s. How do I get Access to do this? Do I run an
update query, key an expression? I have tried to search this out on my own
but can't find anything on it.


It's not clear to me why you would need to change the data
in the table. You can just set the format property of the
form or report text box that displays the part# to
@@@@@@-@@@@
 
Let's see. If there are fifty reports and forms and any new ones that
display this data and it is always to be displayed this way, I can make one
change to the data or I can go change all the reports and forms - Hmm?

Regards
Kevin
 
Let's see. If there are fifty reports and forms and any new ones that
display this data and it is always to be displayed this way, I can make one
change to the data or I can go change all the reports and forms - Hmm?

A third alternative would be to rename the table, and create a query with the
same name as the table making the change.

But if it's not going to interfere with other uses of the table, then yes, I'd
edit the data in the table. Your call!
 
Back
Top