Just moving up from Access 97 and trying 2K. I am used to using the FindFirst method of the RecordsetClone object in order to do form navigation with a combo box. I notice that the wizard in 2K writes the following code in order to accomplish this...
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[req_no] = " & Str(Me![Combo98])
Me.Bookmark = rs.Bookmark
Set rs = Me.Recordset.Clone
My questions are;
1. Why dim the recordset as Object rather than as ADODB.Recordset?
2. Why not use rs.close and/or Set rs = nothing
If if was me doing this I would write...
On Error GoTo EH
Dim rst As ADODB.Recordset
Set rst = Me.Recordset.Clone
rst.Find "req_no = " & Str(Me!cboRequestCode)
Me.Bookmark = rst.Bookmark
rst.Close
SeeYa:
Set rst = Nothing
Exit Sub
EH:
MsgBox Err.Number & " - " & Err.Description
Resume SeeYa
Comments??
Thanks, Chris
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[req_no] = " & Str(Me![Combo98])
Me.Bookmark = rs.Bookmark
Set rs = Me.Recordset.Clone
My questions are;
1. Why dim the recordset as Object rather than as ADODB.Recordset?
2. Why not use rs.close and/or Set rs = nothing
If if was me doing this I would write...
On Error GoTo EH
Dim rst As ADODB.Recordset
Set rst = Me.Recordset.Clone
rst.Find "req_no = " & Str(Me!cboRequestCode)
Me.Bookmark = rst.Bookmark
rst.Close
SeeYa:
Set rst = Nothing
Exit Sub
EH:
MsgBox Err.Number & " - " & Err.Description
Resume SeeYa
Comments??
Thanks, Chris