Access in VB

N

nath

Hi

I am writing some VB forms, not in access, but didnt know
where to ask this question. I have connected to the
Access DB that i want, and have set up the recordset to
extract the relevant records. I have done this in the
form_load part, however, the recordset closes as soon as
the form has loaded. How do i get the recordset to be
open all the time the form is. Once again, this is done
in VB connected to an access DB.

TIA

Nath.
 
N

Neil

How are you connecting to the db? Through code or throught one of the tools
for linking databases?

Neil.
 
N

Neil

I dont know if this would be the best way, but if you declare the variables
in the forms declaration section (at the top), you could use them at any
time while the form is open. What you would do, is connect to the db in the
form_load event and then clean up when the form closes (in the form_unload
event).

Hope this helps,

Neil.
 
N

nath

I'll give it a whirl

Thanks

nath.
-----Original Message-----
I dont know if this would be the best way, but if you declare the variables
in the forms declaration section (at the top), you could use them at any
time while the form is open. What you would do, is connect to the db in the
form_load event and then clean up when the form closes (in the form_unload
event).

Hope this helps,

Neil.




.
 
A

Albert D. Kallal

I would try a VB newsgroup. In vb, you don't necessary need to use code to
create a reocordsset object. What you do is place a "data object" on your
form. You then place controls on the form, and specify that data object for
the reocrtdsouce. We don't have to do that in ms-access, since we have bound
forms. So, you DO have bound controls in VB, and you can even thus have
several recordset objects on the same form at the same time. Each data
object you place on a form (typically you only have one) usually includes a
set of navigation buttons for you.

Hence, you don't need code to load up your recoredset. In fact, if you
define the recordset in the forms on-load, the instant the on-load code
finishes, then the recordset goes out of scope.

If using VB, you might as well use the ADO connection object...
 

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