Ok, new guy here..

VBAWTB

Registered User.
Local time
Today, 09:06
Joined
Sep 26, 2011
Messages
30
I am trying to extract data from a field in a table to a variable so I can use it in a comparison within VBA. But I am getting a type mismatch error and I can't for the life of me see where the mismatch is... here is the code..

Dim dbsSubwayDB As Database
Dim rstSnapShot As Recordset

Set dbsSubwayDB = CurrentDb
Set rstSnapShot = dbsSubwayDB.OpenRecordset("tblSettings")

WkEndngDay = rstSnapShot!weekendingday

...the red is the line the error is on... weekendingday is the field in the tblSettings table..Help! :confused:
 
Change

Dim dbsSubwayDB As Database
Dim rstSnapShot As Recordset

to

Dim dbsSubwayDB As DAO.Database
Dim rstSnapShot As DAO.Recordset
 
Thanks! That was it! And thanks for the very fast reply =]
 

Users who are viewing this thread

Back
Top Bottom