Any Access2000 / Visual Basic programmers here ?
#1
As Scoobynet is the oracle of all info...
Just wondering if anyone can tell me - in the earlier versions of access, eg. access97, the following was ok:
Dim dbs As Database
Dim rst As Recordset
Trouble is, using Access2000, I'm getting a compile error and its pointing to the above lines as the source of the error - anyone know if they replaced the 'database' object in Access2000, and if so, what is the replacement code ?
Full code snippet:
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)
Just wondering if anyone can tell me - in the earlier versions of access, eg. access97, the following was ok:
Dim dbs As Database
Dim rst As Recordset
Trouble is, using Access2000, I'm getting a compile error and its pointing to the above lines as the source of the error - anyone know if they replaced the 'database' object in Access2000, and if so, what is the replacement code ?
Full code snippet:
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)
#2
Daz,
From a Visual Basic code edit window without the code running...
Click Tools > References
From the list of ticked references, do you have any called something like "Microsoft DAO xxxx Object Library".
If not, scroll down the list and you should have a choice of a few. On this PC (Win 2000 Pro + Office 2000 Pro), I have the following...
MS DAO 2.5/3.51 Compatability Library
MS DAO 3.51 Object Library
MS DAO 3.6 Object Library
Tick one, click OK and your code should work.
Actually, do any of the ticked references at the top of the list have MISSING against them? Even if you are not using a function or type from the library marked MISSING, Access will often refuse to compile or run code until the tick is removed from the module or it is installed.
HTH,
ChrisB.
From a Visual Basic code edit window without the code running...
Click Tools > References
From the list of ticked references, do you have any called something like "Microsoft DAO xxxx Object Library".
If not, scroll down the list and you should have a choice of a few. On this PC (Win 2000 Pro + Office 2000 Pro), I have the following...
MS DAO 2.5/3.51 Compatability Library
MS DAO 3.51 Object Library
MS DAO 3.6 Object Library
Tick one, click OK and your code should work.
Actually, do any of the ticked references at the top of the list have MISSING against them? Even if you are not using a function or type from the library marked MISSING, Access will often refuse to compile or run code until the tick is removed from the module or it is installed.
HTH,
ChrisB.
#3
Shot in the dark from someone with no Access 2000 and little VB...
Could it be a DAO 3.6 problem?
Have you set a permanent reference to the DAO 3.6 Object library?
The code looks to be OK.
Good luck!
KF.
Could it be a DAO 3.6 problem?
Have you set a permanent reference to the DAO 3.6 Object library?
The code looks to be OK.
Good luck!
KF.
#5
Thanks all.
Looks like the code was written for an earlier version of Access, and hasn't been converted properly to run on Access2000.
I'll try that tools > options thing.
Looks like the code was written for an earlier version of Access, and hasn't been converted properly to run on Access2000.
I'll try that tools > options thing.
Thread
Thread Starter
Forum
Replies
Last Post
crazyspeedfreakz
Wanted
17
05 October 2015 07:19 PM