Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: recordset problems

    Hi, i have a mainform (frmJob) with a subform (frmtasks), they is a 1 to
    many relationship through TaskID. I also have a results form that displays
    information about the records in the subform (these records also have the
    TaskID in them). At the moment when i double click the results record it
    takes me to the Parent record in the main form, This is fine but i still
    have to find the subform record i doulbe clicked on in my results form. I
    would like the main form to open and setfocus on the record in the subform
    that i double clicked on in my results form using taskID as the link.
    What i have done so far is create variable of TASKID. When i double click
    the record in the results form it captures this, then on the load event of
    the frmtasks i got it do a recordsetclose then a findfirst but it's not
    working. Can some pls help me with correct synax and also how do i set the
    focus on the record it finds. This is what i had.

    Dim rs As DAO.Recordset

    If IsNull(strtaskid) Then
    'do nothing

    Set rs = Me.RecordsetClone
    If Not rs.BOF And Not rs.EOF Then
    Do Until rs.EOF
    rs.FindFirst "[TaskID] = " & strtaskid
    Exit Do

    End If
    End If
    Set rs = Nothing

  2. #2
    Join Date
    Aug 2003

    recordset problem

    En el ejemplo siguiente se utiliza la propiedad RecordsetClone y el objeto Recordset para sincronizar un registro del conjunto de datos con el registro actual del formulario. Cuando el usuario selecciona el nombre de una compañía en un cuadro combinado, se utiliza el método FindFirst para ubicar el registro de esa compañía y la propiedad Bookmark de DAO del objeto Recordset se asigna a la propiedad Bookmark del formulario, haciendo que el formulario muestre el registro encontrado.

    Sub IDProveedor_AfterUpdate()
    Dim rst As Recordset
    Dim cadNombreBúsqueda As String

    Set rst = Me.RecordsetClone
    cadNombreBúsqueda = Str(Me!IdProveedor)
    rst.FindFirst "IdProveedor = " & cadNombreBúsqueda
    ----------> If rst.NoMatch Then
    CuadroMsj "Registro no encontrado "
    Me.Bookmark = rst.Bookmark
    ----------> End If
    End Sub

Posting Permissions

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