Select Statement Problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lebbsy
    New Member
    • May 2007
    • 55

    Select Statement Problems

    I have a datasheet form that on opening I want to select only the records whose Decision field value is "Recommend" . I have the following SQL statement so far but it gives me the "cannot execute select query" error.

    Code:
    strSQL = "SELECT IdentityNumber, Ministry, Surname, Designation, QualificationCategory, Qualification, SubmissionDate" _
            & " FROM [Submission Details]" _
            & " WHERE [Decision] = 'Recommend';"
        dbs.Execute (strSQL)
        Debug.Print strSQL
    All fields are strings.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hello, Lebbsy.

    "Execute" method is for executing action queries (update, delete, append etc). There is nothing to "execute" in SELECT statement.
    If you want to populate your form with records fetched by SELECT statement, then assign your strSQL variable value to Form.RecordSour ce property.

    Regards,
    Fish

    Comment

    • Lebbsy
      New Member
      • May 2007
      • 55

      #3
      Thanks a ton. Just did exactly what you said and the program is running fine.

      Comment

      Working...