Visual Basic in Access

  • Thread starter Nelson The Missing Lead
  • Start date
N

Nelson The Missing Lead

Hi,

I am writing a visual basic procedure as follows:

Public Sub DaysAvg()
'Calculate the average value of a given value.

Dim dbs As Database

Dim rst As DAO.Recordset
Dim varBookmark As Variant
Dim numAve, numDaysAvg As Number
Dim intA, intB, lngCount As Integer

Set dbs = CurrentDb

'Open Table
Set rst = dbs.OpenRecordset("SGX Individual Historical", dbOpenTable)

rst.MoveFirst

Do While Not rst.EOF
intA = 1
intB = 0
varBookmark = rst.Bookmark
" I will not enclose the full code as it too long"


When i debug the code, the 2nd statement encounter problem. I follow exactly
what written in the book but visual basic seem like dun recongise (Dim dbs As
Database)

Please help!!!

Thank you.

Nelson Chou
 

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