Hi...Below is my code where I am trying to get the recordsetclone of one page and take it to an Edit page where I can edit it. There are onlyl two pages, one primary key, Topic Number. Anyone have any ideas where I'm going wrong? I've checked the properties on the Edit form. I've tried bining them and unbounding them to no avail! :confused:
Private Sub btn_EditTopic_Click()
On Error GoTo Err_btn_EditTopic_Click
Dim Criteria As String
Dim MyRS As DAO.Recordset
'Find the record that matches the control
'Check to see if the Details -Edit Topic form is open. If it
'is not open, open it. It has to be open in order to clone the rs
'then need to set focus to Edit Topics
If Not SysCmd(acSysCmdGetObjectState, acForm, "Edit Topic Information") Then
DoCmd.OpenForm ("Edit Topic Information")
End If
'Set the recordset to a copy of the currently displayed data on the TopicInfo screen
Set MyRS = Me.RecordsetClone
'Build the Criteria...where Topic Number = the Forms' TN
Criteria = "Topic_Number= '" & Me!Topic_Number & "'"
'Perform the search
MyRS.FindFirst Criteria
If Not MyRS.NoMatch Then
****ERROR = NOT A VALID BOOKMARK *****
Forms![Edit Topic Information].Bookmark = MyRS.Bookmark
End If
'Close the recordset
MyRS.Close
DoCmd.Close acForm, "[Topic Information]"
'show form 1 with the bookmarked record?
DoCmd.OpenForm ("Edit Topic Information")
Exit_btn_EditTopic_Click:
Set MyRS = Nothing
Exit Sub
Err_btn_EditTopic_Click:
MsgBox Err.Description
Set MyRS = Nothing
Resume Exit_btn_EditTopic_Click
End Sub