Access 2003 and Automatically finding records in forms

J

jneal0331

I currently Have this form setup in 2 sections. The first sectio
includes 2 text boxes for Eligibility Number (field name
EligibilityNum) and the second for School (SchoolName). The secon
section is a subform called sfrmSchools that includes all th
eligibility numbers, schools and other useful information.

I have created an Access 2003 database from a ledger. The main key i
an eligibility number that corresponds to a school. There are over 200
schools in my database. How can I program Access to automatically fin
the record (eligibility number or school) if I type it in the firs
section. For instance if I was looking for a given school with a
eligibility number of 5670A0324. If I type in '56' I would be taken t
those eligibility numbers with 56 to show. Same for if I typed in th
name of a school. If the school I wanted started with 'D', I would b
taken to them
 
M

Marshall Barton

jneal0331 said:
I currently Have this form setup in 2 sections. The first section
includes 2 text boxes for Eligibility Number (field name =
EligibilityNum) and the second for School (SchoolName). The second
section is a subform called sfrmSchools that includes all the
eligibility numbers, schools and other useful information.

I have created an Access 2003 database from a ledger. The main key is
an eligibility number that corresponds to a school. There are over 2000
schools in my database. How can I program Access to automatically find
the record (eligibility number or school) if I type it in the first
section. For instance if I was looking for a given school with an
eligibility number of 5670A0324. If I type in '56' I would be taken to
those eligibility numbers with 56 to show. Same for if I typed in the
name of a school. If the school I wanted started with 'D', I would be
taken to them.


Use the text box's Change event procedure:

With Me.subform.Form.RecordsetClone
.FindFirst "EligibilityNum = '" _
& Me.txtEligibilityNum.Text & "*'"
If .NoMatch Then
Beep
Else
Me.subform.Form.Bookmark = .Bookmark
End If
End With
 

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