How to Access Specific Record in Table?

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I'm new to Access. To get started, all I want to do is
create a Form whereby I can enable a user to type in a
specific Field of a Record and have the Form return all
the fields for that record. For example, the user could
type in a part number and thus view all the fields for
that particular part number. How can I do this?
 
Bill said:
I'm new to Access. To get started, all I want to do is
create a Form whereby I can enable a user to type in a
specific Field of a Record and have the Form return all
the fields for that record. For example, the user could
type in a part number and thus view all the fields for
that particular part number. How can I do this?

Place a text box named txtSearchPart in the form header
section for users to enter the desired part number. There
are then several ways to get the form to display the details
of that part. One simple way is to set the form's Filter
property:
Me.Filter = "PartNum = " & txtSearchPart

Another (and IMO safer) way is to reassign the form's
RecordSource:
Me.RecordSource = "Select * From Parts " & _
"Where PartNum = " & txtSearchPart
 
Thanks, Marshall. I'll try it both ways. Your reply to
Travis answered my next question. You're good!
 
Bill said:
Thanks, Marshall. I'll try it both ways. Your reply to
Travis answered my next question. You're good!

Not that good ;-) I forgot to mention that setting the
Filter property won't do anything unless the FilterOn
property is True:

Me.FilterOn = True

should probably come right after the Me.Filter = . . .

And, be aware that the reason I don't use the filter
property is because there are issues with it. Access has a
tendency to save the setting for the next time you open the
form ...? And, if you have subforms, setting either the
main form's or one of the subform's Filter property will
also clear the Filter in the other ones !?
--
Marsh
MVP [MS Access]


 
Back
Top