Can I source a form on a recordset?

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
 
K

Klatuu

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.
 
M

Marshall Barton

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
. . .
 
V

vsoler

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.
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top