Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching for records within in form

Status
Not open for further replies.

new57

Programmer
Nov 3, 2001
17
US
i would like to search a form:
o by last name
o get all of the interations
o select the record i want
o then have the form display that record

so far i have added a command button in the footer section, and it does a query by last name, and i get the selected records.

i would like to know the next step to get the form to return the record selected

i am on the right track here, or do i need to do something different?

many thanks from a new user to this forum
 
just set an objects source property to that query you made.

In the code for the button make sure you "Requery" the object

In other words:

Button-
set to Your GettheRecordQuery

On click event: ObjectToDisplayRecord.Requery

ObjectToDisplayRecord-
Record Source Property:GettheRecordQuery
 
Hi New57 (Heinz?)

Sounds like Doug is right. Here's another alternative:

(In Access2000) I would use a combo box to accomplish what you want to do. Create a combo box with the first column displaying the last names with all their iterations. 2nd column displays the key that makes each record with the same last name unique.

Use that field to bind to the form. Click on the combo box arrow, display the records by last name, click on the record you want and the record is displayed. This can be accomplished with the wizard selected when you create the new combo box.

Then you can browse the code and see what the wizard produced. It will be something like this:

Code:
Private Sub cboFindByOwner_AfterUpdate()
    ' Find the record that matches the control.
    Dim RS As Object
    Set RS = Me.Recordset.Clone
    RS.FindFirst "[PropertyID] = " & _
       Str(Me![cboFindByOwner])
    Me.Bookmark = RS.Bookmark
    ' If you want to blank the combo box:
    cboFindByOwner = ""
End Sub

Good searching: :-)
Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top