473,378 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Switchboard to tables

I would like to create a switchboard showing all tables that would open each
table upon selecting the control box. The switchboard manager does not
appear to allow you to select specific tables as you can do in forms and
reports. Is anyone aware of a way to do this?

Oct 13 '06 #1
1 2103
Yetti wrote:
I would like to create a switchboard showing all tables that would open each
table upon selecting the control box. The switchboard manager does not
appear to allow you to select specific tables as you can do in forms and
reports. Is anyone aware of a way to do this?
I would do it another way.

Create a new form in Design mode.

Click the Toolbox toolbar to add a listbox.

Drop the listbox on the form. Don't go thru the wizard, cancel when
dragged to it. The name of the listbox, in my code, is List0. If you
use a different name, change any code refs from List0 to your ref name

Open the property sheet for the Listbox by dbl-clicking on the listbox.
Click the Data tab. In the ROWSOURCETYPE, not ROWSOURCE, enter
FillListBox
Now click the "Other" tab to ensure MultiSelect is set to None.

I have provided some code. Copy/Paste the entire code below where you
see the word StartCut. Open up the code module for the form. Paste the
code. Save the code, save the form.

Now open up the form. You will see a list of all of your tables.
Dbl-click on one. It will open the table.

Now you can open the switchboard and have it open this new form.

'startcut here
Option Compare Database
Option Explicit
Private Type ListElements
strTableName As String
End Type
Private Function FillListBox(fld As Control, ID As Variant, row As
Variant, col As Variant, Code As Variant) As Variant
Static strRows() As ListElements
Static Entries As Integer
Dim strTableNameID As Long
Dim tdf As TableDef

Dim ReturnVal As Variant

ReturnVal = Null

Select Case Code
Case acLBInitialize ' Initialize.
'Docmd.Hourglass true
Entries = 0
ReDim Preserve strRows(Entries)

strRows(Entries).strTableName = "Table Name"

For Each tdf In CurrentDb.TableDefs
If Left(tdf.name, 4) <"MSys" Then
Entries = Entries + 1
ReDim Preserve strRows(Entries)
strRows(Entries).strTableName = tdf.name
End If
Next

ReturnVal = True
Case acLBOpen ' Open.
ReturnVal = Timer ' Generate unique ID for control.
Case acLBGetRowCount ' Get number of rows.
ReturnVal = Entries + 1
Case acLBGetColumnCount ' Get number of columns.
ReturnVal = 1
Case acLBGetColumnWidth ' Column width.
ReturnVal = -1 ' -1 forces use of default width.
Case acLBGetValue ' Get data.
ReturnVal = strRows(row).strTableName
Case acLBEnd ' End.
Erase strRows
End Select
FillListBox = ReturnVal
End Function
Private Sub List0_DblClick(Cancel As Integer)
DoCmd.OpenTable Me.List0
End Sub
Oct 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mark | last post by:
I am looking for a switchboard creator alternative for my MDB. Can anyone help me? Thanks for your help, Mark
1
by: ogilby1 | last post by:
Does Access allow a query to be listed on the switchboard? Does Access allow a table to be opened in datasheet view from the switchboard? I have an application where users enter new data, print...
9
by: Baz'noid | last post by:
Hi all, My computer has suddenly decided that it doesn't like the switchboard - it's quite happy to open up on other machines, meaning the database itself isn't at fault, it must be something...
2
by: Terry | last post by:
I have created a switchboard, created using Access 2000. If I put the mouse anywhere on the form, outside of the checkboxes and scroll the wheel backwards, I get the following error. Run-Time...
1
by: Richard Holliingsworth | last post by:
Hello: Thanks for reading this. I'm running A2002 as a front end to SQL Server 7.0. I've finished building my tables, views, forms and reports. Now I want to build the Switcboard form. But...
0
by: Earl Anderson | last post by:
I copied a Household Inventory database template in A97 (WinXP) and modified it for use in my office. Modifications consisted of changing some table names, deleting some fields, adding some fields...
8
by: Ray Greene | last post by:
I was working in Access and everything disappeared from the screen. When I closed and reopened the file there was no switchboard. I can open tables and forms etc if I select a category from the...
2
by: ghadley_00 | last post by:
Hi, Is there a way to have the labels in a MS access database switchboard dynamically generated based on values in a table? I have a table of items (let's call it table Main) , each of which is...
1
by: Lumpy | last post by:
Hi all, I have have been lucky to get some good advice in regards to some access questions I have had so far. The good news is I am almost done with this project but I seem to have hit another...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.