Recordset object holds insufficient fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilanjangm
    New Member
    • Mar 2010
    • 11

    Recordset object holds insufficient fields

    Code:
    strQueryName = "qry_Resource_Details_By_Resource_Name"
        Set dbs = CurrentDb()
        Set qdf = dbs.QueryDefs(strQueryName)
        qdf.Parameters(0) = cmbAllUniqueResource.Value
    
        Set rst = qdf.OpenRecordset()
        MsgBox rst.Fields.Count
    This is displaying 3, however, running the query directly is providing me with the correct output with 18 columns.

    Any idea?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    I can't see anything. But that's understandable as there is little here. I think the SQL of the query is necessary to try to determine what is going on. I can certainly think of nothing off the top of my head that might explain this.

    Comment

    • nilanjangm
      New Member
      • Mar 2010
      • 11

      #3
      Here goes the SQL query.
      Code:
      SELECT *
      FROM tbl_Resource_Master
      WHERE tbl_Resource_Master.Resource_Last_Name+", "+tbl_Resource_Master.Resource_First_Name=[?];
      And the output is all the columns of the table, as expected.

      And, very stupidly, I don't know what happened, it's working fine. And I really feel bad to bother you like this (though I could not find out the reason out yet).

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        I'm not sure what could have caused the issue you describe, however I would look at your use of + for string concatenation as it propagates nulls. Check out Using "&" and "+" in WHERE Clause.

        BTW Don't worry about probems disappearing. That happens quite often. It's generally a good thing ;)

        Comment

        Working...