DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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 12:42 PM.

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links