[AccessD] Find a Word & Put in New Field

Hollis,Virginia HollisVJ at pgdp.usec.com
Wed Sep 24 10:48:55 CDT 2003


Do I put it in a module & run it?
 
I get the error: Expected = on Replace (....
 
Va.
 
 

-----Original Message-----
From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net]
Sent: Wednesday, September 24, 2003 8:09 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Find a Word & Put in New Field




Virginia,

What you could do is something like the following :

Dim MyDocNo as String

MyDocNo = Mid(yourfieldname,Instr(yourfieldname,"DS-"),16)

Replace (yourfieldname,MyDocNo, "")

yourotherfield = MyDocNo

this should work, please remember to back up your table etc before trying it

Paul Hartland




Message date : Sep 24 2003, 02:02 PM 
>From : Hollis,Virginia 
To : 'Access Developers discussion and problem solving' 
Copy to : 
Subject : [AccessD] Find a Word & Put in New Field 
This is a real challenge... 

Is it possible to search a field for certain text, remove the word for 
placement in another field? 

We have a part description that lists the document number in the 
description. The document numbers are all the same length and all start with

DS-, (ex: DS-MDD-15987-001). But the document number might be anywhere in 
the description. The document number needs to be separated out into a field 
by itself. 

There are over 3,000 records & I really don't want to sit here for days 
doing a copy & paste to move the number to a new field. 

Any ideas? Or can this be done at all? 

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030924/88ed47b0/attachment-0001.html>


More information about the AccessD mailing list