View Full Version : MS ACCESS, SQL Query

07-22-2006, 05:12 AM
Hey guys...'nother question.

What's wrong with this query

SELECT tblAIA- 2004 AIA Attendance Log.[AECProgram] FROM tbl2001- AIA Attendance Log

I'm using that statement to pull information from tblAIA and the records in AECProgram to populate a combo box.

That should be right....I just keep getting the following error when I run the form

Syntax Error (missing operator) in query expression 'tblAIA- 2004 AIA Attendance Log.[AECProgram]'

Thank you in advance.

07-24-2006, 06:37 PM
I've gotten my query to work, but not in the way I wanted to. I want to use a combo box to pass the value to be queried: You select a value from the combo box, and click on a submit button. That runs the query with the selected value. Would that have to be done in the VB Code or in the submit buttons properties box?

The information I want passed to the query is AECClass (ranging from 001-005)

I don't think this is right, but here's the code I'm using on the submit button

stQuery = "SELECT tbl2004- AIA Attendance Log.* FROM tbl2004- AIA Attendance Log"
stQuery = stQuery & " WHERE " & cboAECSearch.Value & " = 'AECProgram'"
stDocName = stQuery
stDocName = "qryAECClass"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Thanks again!

07-24-2006, 11:14 PM
Moved to Other Databases forum.