A quick update to a table

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

Comments

6/18/2010 9:11:12 PM #

stephan

Like it have use it thanks

stephan |

Comments are closed

Dislexia

I see people have commented about my style of writting.
Well I have dislexia so spelling is not one of my good points
but when it comes to reading/written code thats the easy bit.

 

 

Poll

What Search Engine Do you use




Show Results

Disclaimer of Liability

While every effort will be made to ensure that the information contained within this website is accurate and up to date, The Company's listed with this web site and any associated parties, make no warranty, representation or undertaking, whether expressed or implied, nor does it assume any legal liability, whether direct or indirect, or responsibility for the accuracy, completeness, or usefulness of any information.

 

Google Ads

Most comments

apply cash advance apply cash advance
1 comments
us United States
cloudy cloudy
1 comments
us United States
mutuelle mutuelle
1 comments
fr France

RecentComments

Comment RSS