S
Shadow
Hi to all,
I'm new to this list and I'm not sure if it's the right place for asking
this question. Any kind of help is much appreciated.
In MS-Access Xp, I've created a new table and I'm trying to access to
the recordset of this table through VB. I'm using the following code for
this purpose.
Sub test()
Dim dbs As database
Dim rs As Recordset
Set dbs = CurrentDb()
Set rs = dbs.openrecordset("mytbl")
MsgBox rs.RecordCount
End Sub
I'm receiving a "Compile Error" on the second (Dim dbs As database) and
third line(Dim rst As Recordset) . If I change it to (Dim dbs) and (Dim
rst) the code runs just fine and gives me the No. of recordcount. Why
should I remove (as database) and (as recordset) to make the code run?
1- After typing (Dim dbs as) Database doesn't exists in the list.
2- After typing (msgbox rst.) the list of properties and methods of rst
doesn't appear.
Thanks for any possible help in advance.
Ghalamkari
I'm new to this list and I'm not sure if it's the right place for asking
this question. Any kind of help is much appreciated.
In MS-Access Xp, I've created a new table and I'm trying to access to
the recordset of this table through VB. I'm using the following code for
this purpose.
Sub test()
Dim dbs As database
Dim rs As Recordset
Set dbs = CurrentDb()
Set rs = dbs.openrecordset("mytbl")
MsgBox rs.RecordCount
End Sub
I'm receiving a "Compile Error" on the second (Dim dbs As database) and
third line(Dim rst As Recordset) . If I change it to (Dim dbs) and (Dim
rst) the code runs just fine and gives me the No. of recordcount. Why
should I remove (as database) and (as recordset) to make the code run?
1- After typing (Dim dbs as) Database doesn't exists in the list.
2- After typing (msgbox rst.) the list of properties and methods of rst
doesn't appear.
Thanks for any possible help in advance.
Ghalamkari