View Full Version : Application Defined or Object Defined Err


canadaboy
01-30-2004, 01:43 PM
I have encountered an error in converting my 2000 database back into '97.

My database has the user check out the next available number for an experiment ID [TestID]. After clicking on a "Save" command button the code assigns this testID # to an integer variable and closes the form.

The "Experiments_FRM" is then opened in 'Add' and 'Hidden' mode. One of the fields in the new record is assigned this test ID#. I then want to take the user to that record to complete any other entry. Below is some of the code I use to do this, but I get the "Application Defined or Object Defined Error" message when the "Set rs = . . . . " line executes.

This was not a problem in 2000 but is in 97. Any thoughts?




stFormName = "Experiments_FRM"

DoCmd.OpenForm stFormName, acNormal, "", "", acFormAdd, acHidden

Forms![Experiments_FRM]![TestID] = stTestID

DoCmd.Save acForm, stFormName
DoCmd.Close acForm, stFormName

DoCmd.OpenForm stFormName

' Find the record in the Main Experiments Form that matches the TestID just issued

Set rs = Forms![Experiments_FRM].Recordset.Clone
' ERROR MESSAGE

rs.FindFirst "[TestID] = '" & stTestID & "'"
Forms![Experiments_FRM].Bookmark = rs.Bookmark

dcx693
01-30-2004, 01:49 PM
Try:
Set rs = Forms![Experiments_FRM].Recordsetclone

canadaboy
01-30-2004, 02:51 PM
Thanks,

That did the trick. That must be a difference between 2000 and '97. I just expected the translator to figure all that out for me.

dcx693
01-30-2004, 09:46 PM
There are many differences to look out for. ADO and DAO syntax is similar in some cases. The translator will only translate file formats so they can be read between Access versions. It's not smart enough to translate code! :)