¡¡

Ä«Å×°í¸®    ·¹ÄÚµå¼Â,dao,ado Á¶È¸:2592
 Á¦¸ñ    Finding records (seek method against table)

******************************************************************************************************

  Finding records (seek method against table)

******************************************************************************************************

'

' Purpose:      Demonstrates use of Seek method against table-type

'               Recordset objects

' Arguments:    none

' Returns:      none

 

Dim db As Database

Dim rec As Recordset

Dim strSQL As String

Dim strMsg As String

 

strSQL = "Bottling"

Set db = CurrentDb()

Set rec = db.OpenRecordset(strSQL)

 

rec.Index = "Price"

rec.Seek "=", curPrice

strMsg = "Bottling No. " & rec("BottlingID") & " costs " & _

    Format$(rec("Price"), "Currency")

 

MsgBox strMsg

rec.Close

End Sub