Find access pengganti rs.find

Posted: 1 September 2008 in Programming

Dalam pembuatan aplikasi sering kita disuruh membubuhi fungsi searching di dalamnya. Nah, kalau kamu familiar dengan NamaRecordset.Find -nya Visual Basic 6 maka kamu bisa gunakan juga di MS. Access Programming dengan cara berikut ini :

Private Sub cmdFindBroker_Click()

Dim DB As Database
Dim Rec As Recordset
Dim RecClone As Recordset
Dim strTable As String
Dim RecordLocation As Variant
Dim stLinkCriteria As String

    strTable = "tblBrokerData2002ToCurrent"

    Set DB = CurrentDb()
    Set Rec = DB.OpenRecordset(strTable, dbOpenDynaset)
    Set RecClone = Rec.Clone

With RecClone

    'Find the BrokerCode in the RecordSet
    .MoveFirst
    .MoveLast
    .FindFirst "MailCode = '" & Me.txtBrokerCode & "'"

If Not .NoMatch Then

    'If Found, Show the Data on the Form
    RecordLocation = .AbsolutePosition
    DoCmd.GoToRecord acDataForm, "frmEnterABrokerCode", acGoTo, RecordLocation

End If

End With
Close....
End Sub

Itu yang bisa aku share, moga bermanfaat.
CMIIW

Comments
  1. Ahmad says:

    minta link2 desaion majalah donk…kirim ke : ergi3_89@yahoo.co.id

    mahrus:
    Wah kok minta link design majalah? kan aku bahas access mas?
    Mending nanya simbah Google yah.
    Btw makasih dah berkunjung.

  2. toha says:

    salam kenal mas…
    semoga semakin sukses..
    amien…

    mahrus:
    Ini Toha mana yah?
    Salam kenal juga, amin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s