Calling code from various procedures
Posted on 1998-11-13
I have a basic question. I know that if I have a public function I can call that from another sub. Here is my problem. in about 30 different places on a form, I need to open a database and recordset(always the same).
so if I have a function that says:
Dim db As DAO.Database
Set db = OpenDatabase("S:\risk\performancesource\dashdatadelete.mdb")
Dim rs As DAO.Recordset
When I Use this sub:
private sub command1_click
I get "object required"
how do I write code in a sub to recognize from another sub?
I am offering 100 points. Please give me a good explanation and some sample code.