1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Switchboard HELP!!

Discussion in 'Business Applications' started by karlhaywood, Apr 12, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    Hi i have just added a switchboard. How do i add one of my tables to the switchboard? i am using access 2005 on xp professional.

    Thanks in advance
    Karl.
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Karl, I never use the Access Switchboard, I prefer to to use a plain Unbound Form and just add Buttons that open Forms and Reports. The Form Button Wizard does the VBA code for you.
     
  3. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    How do i do that OBP? Thanks for your quick reply!
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Go to forms and use the "Create Form in Design View".
    You need the Form Tool box ticked.
    You just select the Command Button Wizard icon in the toolbox, click and drag the button to where you want it and then select the "operation" that you want the button to perform on the left and the Action to perform on the right.
     
  5. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    Hi i cant find the command button? Sorry i am new to access.
     
  6. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    When i press the button how do i get it to open in add mode?
     
  7. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Take a look at this Excel sheet, it has the Printscreen of an Unbound Form in design mode and shows the Command Button Icon in the Toolbox.
     

    Attached Files:

  8. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    Thanks i have the button working, but when i press it nothing happens!
     
  9. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Did you make the necessary selections when the wizard opened?
    I have added the Selections to another PrintScreen below the first one on this sheet.
     

    Attached Files:

  10. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    i want it to open a form in add mode so when i add my data it appears on a spreadsheet. Whic commands will i choose?

    Thanks for the advice.

    P.S

    Is it possible to make a donation?
     
  11. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    karl, I think you can make a donation to the Forum using the Donate which is just under the Tech Support at the top of the screen.

    You can change the VBA that the wizard has produced, in design mode click the command button. In the Properties click the Event tab and there should be "Event Procedure" in the On Click line. Click on the Event Procedure and 3 small dots will appear on the righthand side, click on those and it will take you to the VBA subroutine that does the opening.
    This line of code is what opens the form
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    if you go to the end of the stLinkCriteria and press the , key the VBA Editor will offer you a list of items to choose from, select the first one "acFormAdd". If you can't see that line due to the Editor showing a list of where you are in the statment press the Esc key once. So you should end up with
    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
     
  12. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    Thanks i have done that now what? Thanks again.
     
  13. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    It say the action requires a form name argument how do i do that? Thanks.
     
  14. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Does your VBA look like this
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Customer"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

    stDocName = "Customer" is setting the name of the Form that you want to open, so your VBA should have the name of your form where mine says "Customer".
     
  15. karlhaywood

    karlhaywood Account Closed Thread Starter

    Joined:
    Jan 17, 2010
    Messages:
    680
    Here is my code could you check it for me-

    Private Sub Command0_Click()
    On Error GoTo Err_Command0_Click

    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
    Exit_Command0_Click:
    Exit Sub
    Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click

    End Sub
    Private Sub Command0_Enter()
    nd Sub
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/916339

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice