Solved: Switchboard HELP!!

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

karlhaywood

Thread Starter
Account Closed
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.
 

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.
 

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.
 

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.
 

Attachments

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
Thanks i have the button working, but when i press it nothing happens!
 

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.
 

Attachments

karlhaywood

Thread Starter
Account Closed
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?
 

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
 

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
It say the action requires a form name argument how do i do that? Thanks.
 

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".
 

karlhaywood

Thread Starter
Account Closed
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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top