Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    87

    Unanswered: Open new form and go to record

    Is it possible to make in current form, after button press, to open new form and go to record where textbox "Client" is equal to current open form's textbox "Client" ?

    form A, txtClient = xxx

    after button press, opens form B and goes to record where txtClient = xxx

    Any ideas?

    Thanks

  2. #2
    Join Date
    Mar 2004
    Location
    Berlin, Germany
    Posts
    107
    u can either do it by filterin form B or by searchin the recordset and then setting it by a bookmark.

    easiest thing would be the filter
    code in form a:
    docmd.openForm B
    form_B.filter="Client='" & me.txtClient & "'" ' u could also use a like filter
    form_B.filterOn=true

    or u could use this function:

    Public Function showMatchingRecord(ActiveForm As Form, Criteria As String) As Boolean
    Dim rs As DAO.Recordset
    Set rs = ActiveForm.Recordset.Clone
    rs.FindFirst Criteria
    If Not rs.NoMatch Then ActiveForm.Bookmark = rs.Bookmark
    showMatchingRecord = Not rs.NoMatch
    closeRS rs
    End Function

    dirk


    Quote Originally Posted by YZF
    Is it possible to make in current form, after button press, to open new form and go to record where textbox "Client" is equal to current open form's textbox "Client" ?

    form A, txtClient = xxx

    after button press, opens form B and goes to record where txtClient = xxx

    Any ideas?

    Thanks

  3. #3
    Join Date
    Oct 2005
    Posts
    87
    Ok thanks! It works with filtering

  4. #4
    Join Date
    Mar 2004
    Location
    Berlin, Germany
    Posts
    107

    welcome

    try the like filter .. by this u can only enter parts of the name and u'll get a list of all the names fitting the entry

Posting Permissions

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