Where to put ado statments..

O

Ola Normann

Hi all.

I am realy new to ADO, but I have decided that I have to try this..
I have read several books about access and vba with ado, but there are som
few(??) questions that I need answer on - just to start on the right foot..

First, I have one form I use as a switchboard, and som few subforms. The
subform uses separate tables for each form.

1: Where do i put the statements;
Dim rst As New ADODB.Recordset
Set rst.activeconnection = currentproject.connection
In the subforms open/load for each subform, or do I place them in the
"switchboard", making a unik name for each recordset needed for the whole
app?

2: Same for the rst.open.
Do I use one open for each subform(Open/load), or do I use the .open command
for each command on subform - eg. movefirst, movenext .... ?

3: On subforms; Do I use the rst.fieldname as control source, or do I
allways use the style like me.txtFirstname = rst.txtFirstname?

My problem is, I understand what I can do, but need som help on "how" and
particularly "where"...

Regards.
 

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