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

Odd error setting a form's recordset property

P: n/a
Hello,

I have an MS-Access 2003 (ADP) project that uses SQL2000.

I have a form that displays all "OPEN" items associated with a
particular user. While viewing this form the user can click a search
button that will let them review "CLOSED" or "SUBMITTED" items using
the same form.

I call a stored procedure to get the results of their "Search" and try
to replace the forms.recordset value.

Set RS = objSAP8.GetObjects(intStatusID,
intUserID )

If RS Is Nothing Then
MsgBox ("No Records Match Your Search Criteria.")
Else
' Set the form's Recordset property to the ADO recordset

'--------------------------------------------------------------------------
Set Me.Recordset = RS
End If

This always works find as long as the initial recordset of the form had
data. In other words, if the user comes to this screen initially the
form is loaded with all his open records. If he searches for "closed"
records, the code displays them nicely.

If the user comes to this form having no "open" records and they
execute to the search for closed records it crashes on the:
Set Me.Recordset = RS line telling me:

"Run-time error '2107': The value entered doesn't meet the validation
rule defined for the field or control"

This also de-stabilizes the application and it eventually crashes
Access.

The only difference is the fact that condition of the original
Form.Recordset.

Just wondered if anyone had any insight before I begin the MS-Access
Developer shuffle:

Decompile
Recompile
Create a new project and copy all objects from old into new project.
Rename the application using 666 in the name.
Jump up and down
Stand on one foot.....

Thanks

Dec 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
More info....

The form is currently holding a partially complete "New record" when I
try to set the recordset:

Set Me.Recordset = RS

It's trying to write this new record to the database and all of the
fields are not set.

Since I don't care - is there a way to abandon the current "new" record
and replace the form's data with my new recordset?

Dec 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.