Reputation: 150
The RecordSource is a simple "SELECT field1, field2, field3 FROM table WHERE field1=value" which is set in the Open even of the form (I make sure to Requery) with the value of the where clause being passed via OpenArgs. I am able to add/edit records using the bound controls.
Using Debug.Print on the form's RecordSource (actually via Timer, just to be sure nothing is changing it after the Open event) returns a SQL string which I can then plug in to query design and verify that there are in fact records, yet they fail to populate in the form. Debug.Print on the form's Recordset.RecordCount yields 0.
I am not passing a WHERE clause in my DoCmd.OpenForm statement. The form has a blank filter, is not set to filter on load, and does not allow filters. So, I can't imagine that is messing things up.
What am I missing here?
Upvotes: 0
Views: 878
Reputation: 8780
Depending on how the recordset is opened, it may not show any records until you move forward in the recordset. You can see if this is your problem by typing 'myRecordset.MoveLast' before you do your check on the RecordCount.
Upvotes: 0