Notices
Non Scooby Related Anything Non-Scooby related

Any Access2000 / Visual Basic programmers here ?

Thread Tools
 
Search this Thread
 
Old 19 August 2001, 03:14 PM
  #1  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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)
Old 19 August 2001, 04:08 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Thumbs up

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.
Old 19 August 2001, 04:21 PM
  #3  
KF
Scooby Regular
 
KF's Avatar
 
Join Date: Feb 2000
Posts: 405
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Old 19 August 2001, 04:25 PM
  #4  
KF
Scooby Regular
 
KF's Avatar
 
Join Date: Feb 2000
Posts: 405
Likes: 0
Received 0 Likes on 0 Posts
Post

Haha...
Was composing whilst ChrisB was posting... Looks like DAO could be the culprit.
Old 19 August 2001, 05:15 PM
  #5  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
01 December 2015 09:37 AM
crazyspeedfreakz
Wanted
17
05 October 2015 07:19 PM
Davalar
General Technical
19
30 September 2015 08:54 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM



Quick Reply: Any Access2000 / Visual Basic programmers here ?



All times are GMT +1. The time now is 05:47 PM.