Z
ZRexRider
Hi,
I have a form whose recordset is initially populated by a SQL statement
in the Me.Recordset.RecordSource.
I have a "Search" button that will allow the user to select various
criteria. Their selections are used to build a SQL statement which is
used to populate a variable record set (RS).
To change the contents of the form to these new results I do:
Set Me.Recordset = rs
This was working as expected but then I noticed I was getting blank
rows in my SQL server database. I made a number of fields "not
nullable" to force a failure when this "phantom new record write"
occurred. Turns out the error occurred on the line with Set
Me.Recordset = rs
So my questions are....
* why does replacing the form's recordset force an add of a new record?
* are there any suggestions for working around this?
Thanks
I have a form whose recordset is initially populated by a SQL statement
in the Me.Recordset.RecordSource.
I have a "Search" button that will allow the user to select various
criteria. Their selections are used to build a SQL statement which is
used to populate a variable record set (RS).
To change the contents of the form to these new results I do:
Set Me.Recordset = rs
This was working as expected but then I noticed I was getting blank
rows in my SQL server database. I made a number of fields "not
nullable" to force a failure when this "phantom new record write"
occurred. Turns out the error occurred on the line with Set
Me.Recordset = rs
So my questions are....
* why does replacing the form's recordset force an add of a new record?
* are there any suggestions for working around this?
Thanks