by MYLE
18. June 2010 21:04
base on the dlookup function in MSaccess
Sub UpLookup(Feild, FeildValue, Table, Crit)
Dim SQL As String
Dim DB As Database
Dim rs As Recordset
Set DB = CurrentDb
SQL = ""
SQL = " SELECT " & Table & ".*"
SQL = SQL & " FROM " & Table & ""
SQL = SQL & " WHERE " & Crit
Set rs = DB.OpenRecordset(SQL)
If Not rs.EOF Then
rs.Edit
rs.Fields(Feild) = FeildValue
rs.Update
End If
rs.Close
End Sub
3cad30c3-af01-403f-86a7-df3549682d9f|0|.0
Category: VB, MSaccess
Tags: