Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2005

Tip: Looking for answers? Try searching our database.

Simple Extracter Coding!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kennykee - 06 May 2005 04:39 GMT
How to extract certain alphabet in a field?
eg

[Fruit] = "I like Papaya"

How to extract the alphabets "paya" to another field [Last] using code?

Any solutions?

Thanks in advance

Kennykee
Dirk Goldgar - 06 May 2005 04:51 GMT
> How to extract certain alphabet in a field?
> eg
[quoted text clipped - 5 lines]
>
> Any solutions?

You don't give enough information.  Are you saying you want to look
specificall for a particular literal value, like "paya"?  Or do you want
the last 4 characters of whatever is in [Fruit]?  Or what?

Also, do you want to remove "paya" from [Fruit] when you put it in
[Last], or just leave it there?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

kennykee - 06 May 2005 05:06 GMT
Actually it like this:

All the [Measurements] in the records
30mm X 100mm
20 X 50
20mm X 15mm
30 X 15
Note: some users will put "mm" and some will not put.

I dont want user to put "mm" in these [measurement], so how remove the
character "mm" if user inserts the character "mm" using afterupdate event?

> > How to extract certain alphabet in a field?
> > eg
[quoted text clipped - 12 lines]
> Also, do you want to remove "paya" from [Fruit] when you put it in
> [Last], or just leave it there?
Dirk Goldgar - 06 May 2005 05:26 GMT
> Actually it like this:
>
[quoted text clipped - 8 lines]
> character "mm" if user inserts the character "mm" using afterupdate
> event?

It would have been better to ask the actual question in the first place.
There are a couple of things you could do:

1. Use the text box's KeyPress event to examine each key the user
presses and not accept any except numbers, spaces, and the letter "X".
That's easy to do, but it still won't guarantee that the entry is in the
correct format.

2. In the control's AfterUpdate event, examine the value that was
entered and delete all characters except numeric digits, spaces, and the
"X" character.  You would probably also want to use the control's Exit
event to verify that the (adjusted) entry conforms to the pattern
"<number> X <number>".  That is, you want to make sure that it consists
of three tokens, of which the first and third are numbers and the second
is an "X".  If it doesn't, you would cancel the event to keep the focus
in the control.

You'd probably also want to verify the format in the form's BeforeUpdate
event, so that a record can't be saved unless the field conforms.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.