[AccessD] Edit contents of field.

Arthur Fuller artful at rogers.com
Mon Aug 9 09:24:03 CDT 2004


An even simpler method which doesn't require creation of a new function,
just uses an existing one, is to create an update query that updates the
column of interest using Replace(). Here's a simple example. In the
debug window type:

? replace("test-test-test-test","-","")
Access responds with:
Testtesttesttest

So to do this in a query, in the query builder, change the query type to
update, select the column of interest, and in the update  row type:

replace([ColumnOfInterest],"-","")

Substitute the actual column name for [ColumnOfInterest]. Run the query
and you're done.

The advantage of doing it this way is that you depend neither on the
exact location of the "-", nor the number of them.

HTH,
Arthur

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
- Beach Access Software
Sent: Monday, August 09, 2004 12:35 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Edit contents of field.


Sheri:

Assuming the format is the same, I'd first create a new field to hold
the stripped product number, then use an update query and update the new
field
to:

Left(fldProdNo,2) & Mid(fldProdNo,4,2) & Mid(fldProdNo,7,3) &
Right(fldProdNo,4).

I think that will work.

HTH

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com


----- Original Message ----- 
From: "Sheri Hixson" <sdhi at kalamazoo.net>
To: <accessd at databaseadvisors.com>
Sent: Sunday, August 08, 2004 6:53 PM
Subject: [AccessD] Edit contents of field.


> I'm just not getting this. I have a 30,000 record table that I've
imported.
> The first field has a product number with 4 hyphens - like 
> 12-34-567-8888.
I
> need to take the hyphens out of these product numbers. Hopefully with 
> a query. I have Access XP and need this to be simple and hopefully as 
> easy
as
> possible. Any help would be appreciated.
>
> Dee
>
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list