It's been a long time since I've used Access but I now find myself producing a database at work and i'm provided with Access 03
I'm currently trying to run a query from a value selected in a list box which I will want to enable multiselect on but as I can't even get it to run on one value I will worry about that later
apologies for being a bit of a n00b here but i haven't used Access since 2003
edit: error it displays is cannot execute select query
I'm currently trying to run a query from a value selected in a list box which I will want to enable multiselect on but as I can't even get it to run on one value I will worry about that later
Code:
Option Compare Database
Option Explicit
Private Sub ClassSelect_Click()
On Error GoTo Err_ClassSelect_Click
Dim db As DAO.Database
Dim param As String
Set db = CurrentDb()
Dim qdf As DAO.QueryDef
Set qdf = db.QueryDefs("Class Output")
qdf.Parameters("SlctClass") = Forms!ClassOutput!List0
qdf.Execute
Exit_ClassSelect_Click:
Exit Sub
Err_ClassSelect_Click:
MsgBox Err.Description
Resume Exit_ClassSelect_Click
End Sub
apologies for being a bit of a n00b here but i haven't used Access since 2003
edit: error it displays is cannot execute select query
Last edited: