Results 1 to 4 of 4

Thread: Find record

  1. #1
    Join Date
    Sep 2002
    Location
    USA
    Posts
    66

    Unanswered: Find record

    Find record
    1. I tried to use a Find Record button to search for a specific field, e.g. LastName, FirstName etc. I have a form (frmHouseHold) and a subform (sfrmApplicants) and I placed the Find Record button in the main form., searching a field in the main form works fine, but not for the subform. I even tried creating a separate find record button inside the subform, but wasn’t successful.

    2. And how do I get to print a specific record (current record only) into a report.

    Any help will be greatly appreciated,

    DD

  2. #2
    Join Date
    Sep 2003
    Posts
    17

    Re: Find record

    Originally posted by OCM
    Find record
    1. I tried to use a Find Record button to search for a specific field, e.g. LastName, FirstName etc. I have a form (frmHouseHold) and a subform (sfrmApplicants) and I placed the Find Record button in the main form., searching a field in the main form works fine, but not for the subform. I even tried creating a separate find record button inside the subform, but wasn’t successful.

    2. And how do I get to print a specific record (current record only) into a report.

    Any help will be greatly appreciated,

    DD
    If your report is based on a Query, which is probably the best way to do it.
    Under the field which links the data to the report, lets say ID, In the criteria of the query, you can put:

    Forms!frmYourFormName!ID

    When you open the report from your form, the report should be the one you want.

  3. #3
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: Find record

    1. In the Click event of the Find Record button compose a query with the right criteria. For example:

    Dim strSQL as String
    strSQL = "SELECT Field1, Field1, .. FieldN FROM SomeTable " _
    & " WHERE FieldX = " & Me.SomeControl.Value

    The query should output the same fields as the original table/query upon which you built the subform. Then, set the query as a RecordSource for the subform:

    Me.sfrmApplicants.Form.RecordSource = strSQL



    2. Set the report's Filter property properly before opening the report.

  4. #4
    Join Date
    Sep 2002
    Location
    USA
    Posts
    66

    Find record

    Greetings,

    These are my fields from the table that I’m going to perform search on.
    From tblHouseHold: HholdID, HholdFirstName, HholdLastName, HholdSSN
    From tblApplicants: AppID, AppFirstName, AppLastName
    And am I going to have only one Find Record button in the main form and put the code in the click event, or do I need another one inside the subform?

    Thank you in advance!

    DD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •