This is a super basic question but I'm trying to execute a Query that I'm building via some form values against the MS Access database the form resides in. I don't think I need to go through ADO formally, but maybe I do.
Anyway, some help would be appreciated. Sorry for being a n00b. ;)
You can use the following DAO code to query an Access DB:
Dim rs As DAO.Recordset
Dim db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM Attendance WHERE ClassID = " & ClassID)
do while not rs.EOF
'do stuff
rs.movenext
loop
rs.Close
Set rs = Nothing
In my case, ClassID is a textbox on the form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With