Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS ACCESS, SQL Query

    Hey guys...'nother question.

    What's wrong with this query
    Code:
    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
    Code:
    Syntax Error (missing operator) in query expression 'tblAIA- 2004 AIA Attendance Log.[AECProgram]'
    Thank you in advance.

  • #2
    New Coder
    Join Date
    Mar 2006
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update to my problem

    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
    Code:
        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!

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Moved to Other Databases forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •