Pls Help! How to openrecordset on an MS Access form?

  • Thread starter Thread starter CM
  • Start date Start date
C

CM

Hi there:
I have created a form on MS Access 2000.
This form can display one record at a time using the navigate buttons.

On the form, the following line can be executed:

Me.Form.RecordSource = strSQL

But I don't know how to create a new recordset object, the second line does
not working:

Dim myRecordSet as Recordset
Set myRecordSet = Me.Form.OpenRecordset

I want to know on an MS Access form, what is the equivalent code like:
Set myRecordSet = objDatabase.OpenRecordset(strSQL)

Do I need create a new database object and a connection on the MS Access
form? If so, any sample code?

Thanks!

CM
 
You don't need to create a reocrdset, as ms-access creates one for you.


You can use

me.RecordSetClone

The above is a recordset that you can use,a nd even move the record pointer
independently of the display. Thus, for stuff like sub-form record
processing, or just general record processing stuff it is very good since it
does NOT effect the current record on the display. It is usually the one I
use.


me.RecordSet

The above is the reocrdset, and is attached to the form. You move the record
pointer, the form will show this movement.
 
Back
Top