can I update a data field in Access to include a prefix?

G

Guest

I have a Data Field of Client numbers that I need to add a prefix to (PRE)
before exporting to a text file to import into another program. Is there a
way the data field could be modified to include this prefix
 
G

Guest

Hi Ray,

If the prefix is just for this one-off export, there's no need to update the
table. Instead, create a query that uses a calculated field to add the prefix
'on the fly'. The calculated field will look like this in the query design
view (assuming that the Client Number field is called ClientNum):

ClientNumber: "PRE" & [ClientNum]

In case you want to change it permanently in your table:

1) Open the table in design view. If the ClientNum field is a number field,
change it to a text field with a suitable number of characters, and save the
table.

2) Create an update query that updates the ClientNum field to

"PRE" & [ClientNum]
 
G

Guest

John,
Thanks for your help - it worked perfectly!!!

Thanks again,
Ray Naylor

John Nurick said:
Hi Ray,

If the prefix is just for this one-off export, there's no need to update the
table. Instead, create a query that uses a calculated field to add the prefix
'on the fly'. The calculated field will look like this in the query design
view (assuming that the Client Number field is called ClientNum):

ClientNumber: "PRE" & [ClientNum]

In case you want to change it permanently in your table:

1) Open the table in design view. If the ClientNum field is a number field,
change it to a text field with a suitable number of characters, and save the
table.

2) Create an update query that updates the ClientNum field to

"PRE" & [ClientNum]

--
John Nurick
Microsoft Access MVP


Ray Naylor said:
I have a Data Field of Client numbers that I need to add a prefix to (PRE)
before exporting to a text file to import into another program. Is there a
way the data field could be modified to include this prefix
 
G

Guest

many thanks for this info - worked perfectly and also i pasted the change to
the main table in access

Tina

Ray Naylor said:
John,
Thanks for your help - it worked perfectly!!!

Thanks again,
Ray Naylor

John Nurick said:
Hi Ray,

If the prefix is just for this one-off export, there's no need to update the
table. Instead, create a query that uses a calculated field to add the prefix
'on the fly'. The calculated field will look like this in the query design
view (assuming that the Client Number field is called ClientNum):

ClientNumber: "PRE" & [ClientNum]

In case you want to change it permanently in your table:

1) Open the table in design view. If the ClientNum field is a number field,
change it to a text field with a suitable number of characters, and save the
table.

2) Create an update query that updates the ClientNum field to

"PRE" & [ClientNum]

--
John Nurick
Microsoft Access MVP


Ray Naylor said:
I have a Data Field of Client numbers that I need to add a prefix to (PRE)
before exporting to a text file to import into another program. Is there a
way the data field could be modified to include this prefix
 

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

Top