Can someone help me declare a recordset? I am in the habit of using Me.Recordsource ="SELECT * FROM MyTable" and then Me.Recordset.MoveNext, etc. however... I am trying to make a global function and apparently the Me. anything isn't working out. This is what I have so far:
Dim MyRecSet as Recordset
MyRecSet.Source = "SELECT * FROM MyTable"
MyRecSet.MoveFirst
txtTitle = MyRecSet.Fields("Title"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I am getting run-time error 91: "Object variable or With block variable not set" when I go to set the source of the recordset. What am I missing? Thanks!
Dim MyRecSet as Recordset
MyRecSet.Source = "SELECT * FROM MyTable"
MyRecSet.MoveFirst
txtTitle = MyRecSet.Fields("Title"
I am getting run-time error 91: "Object variable or With block variable not set" when I go to set the source of the recordset. What am I missing? Thanks!