FindRecord


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: FindRecord

  1. #1
    Join Date
    Jan 2006
    Posts
    1

    FindRecord

    I am a new learner in Access 2003 and have found myself stuck on a very simple act. I am trying to find records in a datasheet which is a subform (subfrmCompaniesList) of the form (frmCompaniesList). A command button open on the form (frmCompaniesList) OpenForm "frmFindCompany" where you enter the company to find.

    This work interms of finding the record but I don't know how to move the bookmark (record pointer) in the subform (subfrmCompaniesList).

    Private Sub cmdFind_Click()
    Dim rs As Object
    Set rs = Me.Recordset.Clone

    rs.FindFirst "[Name] Like '" & Me![txtCoName] & "*'"
    If rs.NoMatch Then
    MsgBox Me![txtCoName] & " not found"
    Else
    Me.Bookmark = rs.Bookmark

    Forms!frmCompaniesList!subfrmCompaniesList!Name.SetFocus
    End If
    End Sub

    I am basically trying to achive a similar effect you get with this!!Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

    Please help!!!
    Last edited by LeKool; 01-31-2006 at 01:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center