468,316 Members | 2,063 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

Odd error setting a form's recordset property


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.")
' 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

The only difference is the fact that condition of the original

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

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.....


Dec 13 '05 #1
1 3431
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.

Similar topics

4 posts views Thread by Bryan Tang | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.