Search Feature

  • Thread starter Thread starter Charles Phillips
  • Start date Start date
C

Charles Phillips

Hello,
I have an MS-Access 97 database.
I have created a "Find Record" feature using the following:

Private Sub Combo126_AfterUpdate()
' Find the record that matches the control.

Dim rs As Object

Set rs = Me.Recordset.Clone

rs.FindFirst "[ContactID] = " & Str(Me![Combo126])

Me.Bookmark = rs.Bookmark

End Sub

The list in the combo-box is getting to long, I need to create a "Search"
feature...

The form has four (4) fields (LastName, FirstName, UserID, & EmailAddress)
that I want to use as search criteria.

You must supply data to three (3) of the 4 fields, to get a match...

Can someone point me in the right direction???

Thank you,

Charles L. Phillips
 
There are a number of different ways you can do this. However, the easy way
is to use a set of cascaded ComboBox where the user selects, says, the first
letter of the surname in the 1st ComboBox. The RowSource Query / SQL String
of the 2nd ComboBox should be parametrised so that it returns only surnames
that has the 1st letter matching the letter selected in the 1st ComboBox.
When the user selects a name in the 2nd ComboBox, you then use your existing
code.

For code example, see The Access Web:

<http://www.mvps.org/access/forms/frm0028.htm>

HTH
Van T. Dinh
MVP (Access)
 
Hello,
I'll try this...
"Thank You" for the example...

Charles L. Phillips


Van T. Dinh said:
There are a number of different ways you can do this. However, the easy way
is to use a set of cascaded ComboBox where the user selects, says, the first
letter of the surname in the 1st ComboBox. The RowSource Query / SQL String
of the 2nd ComboBox should be parametrised so that it returns only surnames
that has the 1st letter matching the letter selected in the 1st ComboBox.
When the user selects a name in the 2nd ComboBox, you then use your existing
code.

For code example, see The Access Web:

<http://www.mvps.org/access/forms/frm0028.htm>

HTH
Van T. Dinh
MVP (Access)



Charles Phillips said:
Hello,
I have an MS-Access 97 database.
I have created a "Find Record" feature using the following:

Private Sub Combo126_AfterUpdate()
' Find the record that matches the control.

Dim rs As Object

Set rs = Me.Recordset.Clone

rs.FindFirst "[ContactID] = " & Str(Me![Combo126])

Me.Bookmark = rs.Bookmark

End Sub

The list in the combo-box is getting to long, I need to create a "Search"
feature...

The form has four (4) fields (LastName, FirstName, UserID, & EmailAddress)
that I want to use as search criteria.

You must supply data to three (3) of the 4 fields, to get a match...

Can someone point me in the right direction???

Thank you,

Charles L. Phillips
 

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

Back
Top