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