By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,139 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,139 IT Pros & Developers. It's quick & easy.

Automatic removes data

P: n/a
I want to have a query that removes all dashes for a field
named "item name"
But I don't want to delete the dashes from the table.
What do I have to write in the query?
Thanks
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Since you haven't mentioned which version of Access you're using, I'll
assume the latest.

NoHyphens:Replace([ItemName],"-","")

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Jacky11" <my*****@hotmail.com> wrote in message
news:46**************************@posting.google.c om...
I want to have a query that removes all dashes for a field
named "item name"
But I don't want to delete the dashes from the table.
What do I have to write in the query?
Thanks

Nov 12 '05 #2

P: n/a
Thanks for your response
I have Access 2000
The only thing I want to remove is the
The above code didn't work for me.

"Fredg" <fg******@att.net> wrote in message news:<p%***********************@bgtnsc04-news.ops.worldnet.att.net>...
Since you haven't mentioned which version of Access you're using, I'll
assume the latest.

NoHyphens:Replace([ItemName],"-","")

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.

Nov 12 '05 #3

P: n/a
Jacky,
This will work in all versions of Access.

Copy and Paste the following function into a Module.

Function RemoveChar(FieldIn As String) As String

Dim intX As Integer
Dim intY As Integer
intY = 1
Dim NewString As String

intX = InStr(1, FieldIn, "-")
Do While intX <> 0
NewString = NewString & Mid(FieldIn, intY, intX - intY)
intY = intX + 1
intX = InStr(intY, FieldIn, "-")
Loop
NewString = NewString & Mid(FieldIn, intY, Len(FieldIn) - intY + 1)
RemoveChar = NewString

End Function
======

You can call it from a query:
NoHyphens:RemoveChar([ItemName])

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Jacky11" <my*****@hotmail.com> wrote in message
news:46**************************@posting.google.c om...
Thanks for your response
I have Access 2000
The only thing I want to remove is the -
The above code didn't work for me.

"Fredg" <fg******@att.net> wrote in message

news:<p%***********************@bgtnsc04-news.ops.worldnet.att.net>...
Since you haven't mentioned which version of Access you're using, I'll
assume the latest.

NoHyphens:Replace([ItemName],"-","")

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.