Results 1 to 2 of 2
2002-04-19, 23:26 #1
- Join Date
- Aug 2001
- Evergreen, CO, USA
- Thanked 60 Times in 60 Posts
Switchboard forms code (Access2002 sr0)
This is a strange one! It turns out that the switchboard wizard in Access 2002 assumes you are always using ADO, or at least it appears that way. In fact, if you create a module, remove ADO as a reference and add DAO 3.6 as a reference, then create a new switchboard, it still creates ADO code as follows:
' Find the item in the Switchboard Items table
' that corresponds to the button that was clicked.</font color=448800><font color=blue>
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
stSql = "SELECT * FROM [Switchboard Items] "
stSql = stSql & "WHERE [SwitchboardID]=" & Me![SwitchboardID] & " AND [ItemNumber]=" & intBtn
rs.Open stSql, con, 1 ' 1 = adOpenKeyset</font color=blue>
This seems to work just fine, even if you don't have a reference to ADO set - most peculiar. However on at least two PCs, even with a reference set to ADO the code fails when it tries to establish the connection - the first code line above. These are PCs running Office 2000 sr1. Of course there are a dozen or more where it works just fine with the same general configuration, and my own PC which only has Office 2k installed. Has anybody else encountered problems of this sort?
BTW, Access 2000 and Access 97 both use DAO for the switchboard code. It looks like the bottom line is if you want to run an application on Office 2000 PCs, don't develop it on an Office 2002 PC.Wendell
2002-04-26, 10:40 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Switchboard forms code (Access2002 sr0)
You can modify the code behind the switchboard to use DAO instead of ADO.
The first time you select the Tools/Add-ins/Switchboard menu option, Access creates the Switchboard Items table and the Switchboard form. Thereafter, Access never looks at the form again; the menu option just changes records in the Switchboard Items table. So you can modify the form any way you like.