Hi,
Can anyone advise what is wrong with this?
Database stores funding requests and this code fires when a new funding request is added to the DB. The intention being to update the search combo boxes, the subform that shows pending requests and to jump to the most recently added request (from the new patient details that are temp stored in the temp table above)
The requeries and setfocus work as does the mrsPatients grab of the hospital number - cant work out why the rest doesnt work though. Also not sure if it is meant to be recordsetclone or recordset.clone but neither work
Thanks
Can anyone advise what is wrong with this?
Code:
Public Function newpriorapp()
Dim rs As Object
Set mdbthis = CurrentDb
Set mrsPatients = mdbthis.OpenRecordset("temptable-priorapp-data", dbOpenDynaset)
Set rs = [Form_form-main-menu].Recordset.Clone
[Form_form-main-menu].searchhospnum.Requery
[Form_form-main-menu].searchpatname.Requery
[Form_form-main-menu].subform_show_pending.Requery
rs.FindFirst "[HospNum] = '" & mrsPatients("HospNum") & "'"
If Not rs.EOF Then [Form_form-main-menu].Bookmark = rs.Bookmark
[Form_form-main-menu].NHSNum.SetFocus
End Function
Database stores funding requests and this code fires when a new funding request is added to the DB. The intention being to update the search combo boxes, the subform that shows pending requests and to jump to the most recently added request (from the new patient details that are temp stored in the temp table above)
The requeries and setfocus work as does the mrsPatients grab of the hospital number - cant work out why the rest doesnt work though. Also not sure if it is meant to be recordsetclone or recordset.clone but neither work
Thanks