Last active
August 29, 2015 13:56
-
-
Save goliver79/8821748 to your computer and use it in GitHub Desktop.
[MSACCESS] Database Query and Recordset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim db As Database | |
Dim rs As Recordset | |
Dim sql As String | |
Dim id as Integer | |
id = 20 | |
sql = "SELECT * FROM MyTable " & _ | |
"WHERE id = " & id | |
Set db = CurrentDb | |
Set rs = db.OpenRecordset(sql) | |
If Not (rs.EOF And rs.BOF) Then | |
'id found!! | |
log rs!name | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment