Can I source a form on a recordset?

  • Thread starter Thread starter vsoler
  • Start date Start date
V

vsoler

A bounded form is based on a table or query. But, can I base it on a
recordset?

If yes, where could I find a coded example for editing a recordset
with a form?

Thank you
 
Forms use either a query or a table as the record source. Technically
speaking, it is a recordset. What is it you are trying to accomplish?
Perhaps we can offer some suggestions.
 
vsoler said:
A bounded form is based on a table or query. But, can I base it on a
recordset?

If yes, where could I find a coded example for editing a recordset
with a form?


Check VBA Help on the Recordset Property.

For example, a form could contain code like:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset( . . .
Set Me.Recordset = rs
. . .
 
Check VBA Help on the Recordset Property.

For example, a form could contain code like:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset( . . .
Set Me.Recordset = rs
        . . .

After I edit the recordset with a form (append, edit, delete records),
how do I write the recordset down to disk as a new table?

That's what I'd like to do.
 
vsoler said:
After I edit the recordset with a form (append, edit, delete records),
how do I write the recordset down to disk as a new table?


Record by record. Probably by opening another recordset on
the table and copying the fields in each records from one
recordset to the other.

But that sounds like a long way around when you could just
use the final table in the first place. If the original
recrodset came from some other table, then you could use an
append query to prepopulate the final table.
 
Back
Top