Obtain first two words in memo field

TryingMyBest

Registered User.
Local time
Today, 15:07
Joined
Nov 18, 2004
Messages
54
OK guys....nearly there with this DB of mine, however the customer is now asking for things that are miles over my head.

I need to programmatically retrieve the first two words of my memo field (before the record is created) so that they can be added to a table. I haven't the first clue where to start with this. Any help very welcome.

If I can't retrieve words I guess the first 15 characters would do. It's just so that a records can be referenced and found easily...the customer finds numbers a difficult way of retrieving records and doesn't want a new field added for a record name! :(

All forms are unbound and I'm using Access 2002.

Many thanks
Jo
(seriously losing the will to live now!) :rolleyes:
 
Jo, I did that code quikly, but appearly functions...

Private Sub Command0_Click()
FirstSpace = InStr(1, Text0, " ")
FirstWord = Left(Text0, FirstSpace - 1)
SecondSpace = InStr(FirstSpace + 1, Text0, " ")
SecondWord = Mid(Text0, FirstSpace, SecondSpace - FirstSpace)
MsgBox "First Word: " & FirstWord
MsgBox "Second Word: " & SecondWord
End Sub

Where:
Command0 = button to execute
Text0 = textbox to write the string

[]s
 
Thank you

I'll give this a go now in my DB. I'll get back to you and let you know if this works for me.
 
Perfect!

Thank you very much....this is perfect for me. Have got it working and storing the result in my table.

:D :D :D :D
 

Users who are viewing this thread

Back
Top Bottom