Advertisement

04.22.2008 at 01:59PM PDT, ID: 23344596
[x]
Attachment Details

Create a Switchboard in Access 2003

Asked by rrtraverse in Access Forms, Access Coding/Macros

Tags: Microsoft, Access, 2003, Switchboard, Access 2003

I am attempting to create a switchboard in Access 2003.  
This is what I have done so far:
I have manually created a table [ObjectList] in my Access database which includes a column for ObjectID [auto number, primary key], ObjectTitle [form or report title], and ObjectType [Form or Report].  


I then manually created a form where I added a Combo Box to the form and a Command button.  For the Combo Box, I select "I want the combo box to look up the values in a table or query", select the ObjectTitle and ObjectType fields from the ObjectList table.  
The Command Button Wizard walked me through choosing a catagory and Action [I chose Form Operations -> Open a Form].  
The Command Button then asks you to choose a form from a list, which I did.  
I then chose to "Open the form and show all the records."
I then elected to show text on my Command Button, i.e. "OPEN", and named the Command Button "OpenForm".  The Command Button works for the single form I selected during the above process.

Now I want to edit this Command Button so that it opens any of the forms available for selection from the combo box, so I access the Properties on the Command Button -> go to Event tab-> from "On Click" line, I click on the elipsis next to Event Procedure.  This opens the code window:

Private Sub OPEN_Click()
On Error GoTo Err_OPEN_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "ADD X"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_OPEN_Click:
    Exit Sub

Err_OPEN_Click:
    MsgBox Err.Description
    Resume Exit_OPEN_Click
   
End Sub

I thought I would be able to edit the command button to open any of the forms or reports listed in the combo box, where the data in the combo box comes from the ObjectList table.  Am I wrong, or just in over my head?  


 
 Start Free Trial
[+][-]04.22.2008 at 05:59PM PDT, ID: 21416919

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.05.2008 at 02:31PM PDT, ID: 21503197

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Access Coding/Macros
Tags: Microsoft, Access, 2003, Switchboard, Access 2003
Sign Up Now!
Solution Provided By: rrtraverse
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628