By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,040 Members | 480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,040 IT Pros & Developers. It's quick & easy.

Recordset object holds insufficient fields

P: 11
Expand|Select|Wrap|Line Numbers
  1. strQueryName = "qry_Resource_Details_By_Resource_Name"
  2.     Set dbs = CurrentDb()
  3.     Set qdf = dbs.QueryDefs(strQueryName)
  4.     qdf.Parameters(0) = cmbAllUniqueResource.Value
  6.     Set rst = qdf.OpenRecordset()
  7.     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?
Mar 6 '10 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,770
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.
Mar 7 '10 #2

P: 11
Here goes the SQL query.
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tbl_Resource_Master
  3. 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).
Mar 7 '10 #3

Expert Mod 15k+
P: 31,770
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 ;)
Mar 8 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.