Also, when dragging and dropping phone numbers, I would like the area code
defaulted, in my case to 503. That way, if the text value is just 345-3434,
the field gets set to 503-345-3434.
----------
Will Pittenger
E-Mail: mailto:will.pi...@verizon.net
All mail filtered by Qurb (www.qurb.com)
Drag and drop is not supported in Access.
A field mask is different from a field format and I suspect you are
interested in the latter.
It is usually better to use a text field and @@@ @@@-@@@@. This is
especially true if you are pasting non numeric characters.
that way 3451234 formats as 345-1234 and the leading "-" does not show.
If you paste a value in that contains any characters you do not want, you
will have to write code to strip those characters. The Replace function
would be ideal for this.
You could then check to see if the string was 7 characters long and add 503
to it if needed.
I can drag text that I select in IE to my field in Access. It acts like I
typed it my self.
How do I put that code into Access?
----------
Will Pittenger
E-Mail: mailto:will.pi...@verizon.net
All mail filtered by Qurb (www.qurb.com)
"Mike Painter" <mddotp...@sbcglobal.net> wrote in message
news:45u1d.19352$Lk3....@newssvr27.news.prodigy.com...
The replace function is described in help. It would appear in probably the
on exit event.
Clearly this is not a macro and the expression builder is used to build
expressions.
You should have the option of "event procedure" and that is what this is.
I don't know how Replace handles the replacement you give as an example.
Try it and find out.
I suspect it will do as your example but you need each item in a string such
as "().-" replaced item by item. It would be easy to build a function that
did this but Pick Basic is the only Basic I know that has it.
>Either that or I would remove all such characters entirely and let the input
>mask format the string.
That's what I would suggest. You can use three or four Update queries,
one for each character - update Phone to
Replace([Phone], "(", "")
and similarly for the other punctuation, including blank.
John W. Vinson[MVP]
(no longer chatting for now)
RemoveCharFromString([field], "(). ")
----------
Will Pittenger
E-Mail: mailto:will.pi...@verizon.net
All mail filtered by Qurb (www.qurb.com)
"Mike Painter" <mddotp...@sbcglobal.net> wrote in message
news:tK22d.15992$QJ3....@newssvr21.news.prodigy.com...
PickConvert( String, "abc", "12")
If string is "a bad boy calls" the result should be "1 21d 2oy 1lls"
a matches and is replaced by 1.
b matches and is replaced by 2.
c has no match so is removed.
Replace makes it easy to do.