|
| |
|
|
fredecd
Posts: 312 Joined: 12/3/2003 From: Louisiana, USA Status: offline
|
Access Find and replace - 5/23/2005 11:44:38
I am trying to do a find/replace in Access to replace values in my database. Access does not seem to be cooperating, and does not find values that I want to replace, or only finds one value and replaces it, when there are obviously numerous entries of the same value. Is there a trick to the find/replace in Access that is different from the other Microsoft programs? Any advice would be appreciated. Thanks
_____________________________
Chris http://www.sightbysite.net
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Access Find and replace - 5/23/2005 11:52:02
Can you be specific? Are you trying to replace whole records, whole field values, or just certain text in fields? Are you doing this actually inside Access or via a web page?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
fredecd
Posts: 312 Joined: 12/3/2003 From: Louisiana, USA Status: offline
|
RE: Access Find and replace - 5/23/2005 12:03:24
I am trying to replace a field in Access. The original database creator set up a field called strName, and has each employees name set up with first name and last name in the strName column, "Joe Smith" for example. We would like to edit all records to change it to "Smith, Joe" in each instance. Some of the pages now pull records based on strName, and I wanted to do a global change in the database for each employee name in each table. I realize that the system should have been set up with the unique ID's instead of the strName, but we are trying to undo something that we inherited without starting over.
_____________________________
Chris http://www.sightbysite.net
|
|
|
|
fredecd
Posts: 312 Joined: 12/3/2003 From: Louisiana, USA Status: offline
|
RE: Access Find and replace - 5/23/2005 13:37:42
Thanks, Roger. When I ran it, I got the following error: Database Results Error Description: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'InStrRev' in expression. Number: -2147217900 (0x80040E14) Source: Microsoft OLE DB Provider for ODBC Drivers
_____________________________
Chris http://www.sightbysite.net
|
|
|
|
fredecd
Posts: 312 Joined: 12/3/2003 From: Louisiana, USA Status: offline
|
RE: Access Find and replace - 5/23/2005 14:15:47
Now it tells me that the expression entered contains invalid syntax, and I must have entered an operand without an operator. I am entering the sql using expression builder in query design mode. Is that correct?
_____________________________
Chris http://www.sightbysite.net
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Access Find and replace - 5/23/2005 14:31:57
Hmmm. You should have just been able to replace the field and table neames with yours and paste it into a query in SQL mode. I'm using Access 2002. Can you post the exact query that is giving you the error as well as table and field names?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
fredecd
Posts: 312 Joined: 12/3/2003 From: Louisiana, USA Status: offline
|
RE: Access Find and replace - 5/23/2005 14:37:07
I am using Access 2000. UPDATE tblOperators SET strName = Right(strName,Len(strName)-InStrRev(strName," ")) & ", " & Left(strName,(InStrRev(strName," ")-1));
_____________________________
Chris http://www.sightbysite.net
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Access Find and replace - 5/23/2005 15:23:43
That is very strange. I setup a DB table called 'tblOperators' and in it I put a field 'strName' and used that exact query: UPDATE tblOperators SET strName = Right(strName,Len(strName)-InStrRev(strName," ")) & ", " & Left(strName,(InStrRev(strName," ")-1)); and it worked fine for me. 1. You are using this in Access and not on a web page. 2. The table is named tblOperators 3. The field is a text field named strName 4. You have write priviledges to the DB If all of those are OK, have you tried downloading a local copy and testing on that? Any ideas with that?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: Access Find and replace - 5/24/2005 14:04:25
quote:
Computers are a wonderful thing. The exact script that would not work yesterday works fine today. like spouses?
_____________________________
Dan
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|