yes, here is an example for you
~~~~~~~~~~~~~~~~~~~~~
you have a form for displaying or editing records.
In the header of the form, you have:
1. an unbound textbox named SrchMemo
(label caption --> Text to Find

2. an unbound option frame named FraSrchMemo
optionbutton: value, caption
1, beginning
2, middle
3, end
4, exact
3. a unbound listbox named FindPeople whose recordsource is
PersonID,
Lastname & ', ' & Firstname as Person,
ColumnCount --> 2
ColumnWidths --> 0;1.5
ListWidth --> 1.5
in code behind a form
'~~~~~~~~~~~~~~~
'written by Crystal
'strive4peace2006 at yahoo dot com
Private Function FilterListbox()
dim mWhere as string
if isNull(me.SrchMemo) then
mWhere = ""
else
select case me.FraSrchMemo
case 1
mWhere = "MemoFieldname LIKE '" _
& me.FraSrchMemo _
& "*'"
case 2
mWhere = "MemoFieldname LIKE '*" _
& me.FraSrchMemo _
& "*'"
case 3
mWhere = "MemoFieldname LIKE '*" _
& me.FraSrchMemo _
& ""
case 4
mWhere = "MemoFieldname = '" _
& me.FraSrchMemo _
& "'"
end select
end if
FindPeopleSQL mWhere
End Function
'~~~~~~~~~~~~~~~
Private Function FindPeopleSQL(byVal pWhere as string)
Dim strSQL as string
strSQL = "SELECT PersonID, " _
& Lastname & ', ' & Firstname as Person " _
& " FROM Tablename " _
& iif(len(mWhere)=0,""," WHERE " & mWhere) _
& "ORDER BY Lastname, Firstname;"
'comment next line or remove after debugged
debug.print strSQL
me.FindPeople.RowSource = strSQL
me.FindPeople.Requery
End Function
'~~~~~~~~~~~~~~~
Private Function FindRecord()
'thanks for ideas, freakazeud
If IsNull(Me.ActiveControl) Then Exit Function
'save current record if changes were made
If me.dirty then me.dirty = false
Dim mRecordID As Long
mRecordID = Me.ActiveControl
Me.ActiveControl = Null
Me.RecordsetClone.FindFirst "PersonID= " & mRecordID
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Function
End If
End Function
'~~~~~~~~~~~~~~~
You would also want to include error handling code -- left
it out to just give you an idea of logic
'~~~~~~~~~~~~~~~
on these controls
SrchMemo
FraSrchMemo
AfterUpdate event -->
=FilterListbox()
on FindPeople AfterUpdate event -->
=FindRecord()
It sounds, however, that you may need to take some of the
information out of your memo field such as: Language_Main,
Language_Second that should have their own fields. Memo
fields are good for extra comments, but don't make the
mistake of lumping discreet pieces of information into a
comment field.
Warm Regards,
Crystal
Microsoft Access MVP 2006
remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day
