Find record in my form

G

Guest

In my combo box I have 'Name' data field, in the 'Name' column I have First,
Middle and Last name.
When I select name from drop down list every thing works fine and also if I
type first 2 letters it will find my record base on the firs word, but what I
need is to able to also filtering second, third words from the same row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
G

Guest

This is not working. It is only finding data by first word in the row, i need
also able to find by all the words in the same row.

Douglas J. Steele said:
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


GGill said:
In my combo box I have 'Name' data field, in the 'Name' column I have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and also if
I
type first 2 letters it will find my record base on the firs word, but
what I
need is to able to also filtering second, third words from the same row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
D

Douglas J. Steele

Assuming you put both asterisks in, it should return all rows that have
what's in Me![Combo36] anywhere in the string.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


GGill said:
This is not working. It is only finding data by first word in the row, i
need
also able to find by all the words in the same row.

Douglas J. Steele said:
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


GGill said:
In my combo box I have 'Name' data field, in the 'Name' column I have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and also
if
I
type first 2 letters it will find my record base on the firs word, but
what I
need is to able to also filtering second, third words from the same
row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
G

Guest

In the form I have a field in which I want to type any part of the Name field
in my form and I want to retrieve all the records that have this part of the
name.
Combo36 is name of the combo box.
Row Source Combo36 is;
SELECT [tblInfo].[Name] FROM [tblInfo] ORDER BY [tblInfo].[Name];

On after update i have this

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"
Me.Bookmark = rs.Bookmark

End Sub




Douglas J. Steele said:
Assuming you put both asterisks in, it should return all rows that have
what's in Me![Combo36] anywhere in the string.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


GGill said:
This is not working. It is only finding data by first word in the row, i
need
also able to find by all the words in the same row.

Douglas J. Steele said:
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


In my combo box I have 'Name' data field, in the 'Name' column I have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and also
if
I
type first 2 letters it will find my record base on the firs word, but
what I
need is to able to also filtering second, third words from the same
row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
D

Douglas J. Steele

Are you sure that the combo box is returning what you think it is?

To be honest, it's rather unusual to have a combo box, and yet use what you
typed into it as a wildcard.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


GGill said:
In the form I have a field in which I want to type any part of the Name
field
in my form and I want to retrieve all the records that have this part of
the
name.
Combo36 is name of the combo box.
Row Source Combo36 is;
SELECT [tblInfo].[Name] FROM [tblInfo] ORDER BY [tblInfo].[Name];

On after update i have this

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"
Me.Bookmark = rs.Bookmark

End Sub




Douglas J. Steele said:
Assuming you put both asterisks in, it should return all rows that have
what's in Me![Combo36] anywhere in the string.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


GGill said:
This is not working. It is only finding data by first word in the row,
i
need
also able to find by all the words in the same row.

:

rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


In my combo box I have 'Name' data field, in the 'Name' column I
have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and
also
if
I
type first 2 letters it will find my record base on the firs word,
but
what I
need is to able to also filtering second, third words from the same
row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
G

Guest

Yes, it works when i tupe 2 letters of the first word in the row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'ma'
then it will pull second record, whitch ic correct.
But if for example type
'la'
it is not finding record and should be pulling third record.

Douglas J. Steele said:
Are you sure that the combo box is returning what you think it is?

To be honest, it's rather unusual to have a combo box, and yet use what you
typed into it as a wildcard.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


GGill said:
In the form I have a field in which I want to type any part of the Name
field
in my form and I want to retrieve all the records that have this part of
the
name.
Combo36 is name of the combo box.
Row Source Combo36 is;
SELECT [tblInfo].[Name] FROM [tblInfo] ORDER BY [tblInfo].[Name];

On after update i have this

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"
Me.Bookmark = rs.Bookmark

End Sub




Douglas J. Steele said:
Assuming you put both asterisks in, it should return all rows that have
what's in Me![Combo36] anywhere in the string.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


This is not working. It is only finding data by first word in the row,
i
need
also able to find by all the words in the same row.

:

rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


In my combo box I have 'Name' data field, in the 'Name' column I
have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and
also
if
I
type first 2 letters it will find my record base on the firs word,
but
what I
need is to able to also filtering second, third words from the same
row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 
D

Douglas J. Steele

Sorry, I see no reason why it shouldn't be working.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


GGill said:
Yes, it works when i tupe 2 letters of the first word in the row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'ma'
then it will pull second record, whitch ic correct.
But if for example type
'la'
it is not finding record and should be pulling third record.

Douglas J. Steele said:
Are you sure that the combo box is returning what you think it is?

To be honest, it's rather unusual to have a combo box, and yet use what
you
typed into it as a wildcard.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


GGill said:
In the form I have a field in which I want to type any part of the Name
field
in my form and I want to retrieve all the records that have this part
of
the
name.
Combo36 is name of the combo box.
Row Source Combo36 is;
SELECT [tblInfo].[Name] FROM [tblInfo] ORDER BY [tblInfo].[Name];

On after update i have this

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"
Me.Bookmark = rs.Bookmark

End Sub




:

Assuming you put both asterisks in, it should return all rows that
have
what's in Me![Combo36] anywhere in the string.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


This is not working. It is only finding data by first word in the
row,
i
need
also able to find by all the words in the same row.

:

rs.FindFirst "[Name] Like '*" & Me![Combo36] & "*'"


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


In my combo box I have 'Name' data field, in the 'Name' column I
have
First,
Middle and Last name.
When I select name from drop down list every thing works fine and
also
if
I
type first 2 letters it will find my record base on the firs
word,
but
what I
need is to able to also filtering second, third words from the
same
row.
For example I have three records in my form

1 John Smith Michael
2 Marta Kay Stony
3 Sam Kevin Larry

So if I type in my combo box 2 letters

'st'

Then it should pull second record 'Marta Kay Stanly'

Please help me,
Thank you

Private Sub Combo36_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo36] & "'"
Me.Bookmark = rs.Bookmark
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top