Something does not work When trying to get a value from the table, getting an error "A runsql action requires an argument consisting of an sql statement"
As I found "DoCmd.RunSQL" statement is not used with select statement.
Then I've changed DoCmd to:
Still getting an error , but "Microsoft Access can't find the object 'Select.."
What's the right way to get a value?
Code:
Private Sub cboEmpID_AfterUpdate()
Dim SQL As String
SQL = "SELECT ID, Class" & _
" From Employee " & _
" WHERE ID = " & cboEmpID.Value & ";"
DoCmd.RunSQL SQL
End Sub
Then I've changed DoCmd to:
Code:
DoCmd.OpenQuery SQL
What's the right way to get a value?