If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Calling forms using Switchboard
How can I call a form in a Datasheet View using a Switchboard?
|
#2
|
|||
|
|||
Your question is rather short on details. Assuming that you can already open
the form from the switchboard, open the form in design view. Double click the little box at the very top left corner to open the form's property sheet. Click the format tab and change the default view to Datasheet. If you need to add to the switchboard a command button for opening the form you could use the wizard (see Help for details). If you need the option of opening the form in different views you can use code, but I will wait to see if you specify that requirement. "kash" wrote: How can I call a form in a Datasheet View using a Switchboard? |
#3
|
|||
|
|||
Hi,
The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#4
|
|||
|
|||
I tried the previous post, and it gave me an error executing the command. By
searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#5
|
|||
|
|||
I know how reliant you can become on message boards when you have a problem
that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#6
|
|||
|
|||
Calling forms using Switchboard
I was just having this exact problem and found your post. Excellent and
thoroughly researched process. Thank you!!! -- THX cs "NewSysAdmin" wrote: I know how reliant you can become on message boards when you have a problem that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#7
|
|||
|
|||
Calling forms using Switchboard
This is very helpful. But, for those of us who don't usually write code. To
do this go to "Tools, Macro, Visual Basic Editor". After Visual Basic Editor opens, find the "Form_Switchboard" then begin scrolling through to find the codes. Thanks you!!! "Cydney" wrote: I was just having this exact problem and found your post. Excellent and thoroughly researched process. Thank you!!! -- THX cs "NewSysAdmin" wrote: I know how reliant you can become on message boards when you have a problem that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#8
|
|||
|
|||
Calling forms using Switchboard
I am totally confused, and having this same problem.
Looking at the code, I already have a #9, for "Const conCmdOpenPage". I tried to insert a new line as #10 for "Const conCmdOpenFormDatasheet: but no luck. Please help! "NewSysAdmin" wrote: I know how reliant you can become on message boards when you have a problem that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#9
|
|||
|
|||
Calling forms using Switchboard
Thanks for the post, Same issue in 2007 and I believe thius will help me to
solve.Thanks again. "NewSysAdmin" wrote: I know how reliant you can become on message boards when you have a problem that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
#10
|
|||
|
|||
Calling forms using Switchboard
Thanks for the tip, I too don't usually use teh coding method; therefore your
tip was a big help! "Ahoy" wrote: This is very helpful. But, for those of us who don't usually write code. To do this go to "Tools, Macro, Visual Basic Editor". After Visual Basic Editor opens, find the "Form_Switchboard" then begin scrolling through to find the codes. Thanks you!!! "Cydney" wrote: I was just having this exact problem and found your post. Excellent and thoroughly researched process. Thank you!!! -- THX cs "NewSysAdmin" wrote: I know how reliant you can become on message boards when you have a problem that you're stuck on, so I'm posting the following solution. Sorry, I posted the previous response without testing it fully. My previous post appears to work until you try another page of the Switchboard, when you click the 6th and 7th buttons, it does the same thing (tries to open a form in datasheet view), which I did not want. Please see below for the solution I found that REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It involves changing the Switchboard code. Open the Switchboard code. Find the area that has this: ' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3 Const conCmdOpenReport = 4 Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6 Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Add one more line to the list like this: Const conCmdOpenFormDatasheet = 9 Now go a little further down the code until you come to this area: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Any other command is unrecognized. Case Else MsgBox "Unknown option." In between these two areas we want to add another one for datasheet view. Add in this new code in the middle so it looks like this: ' Run code. Case conCmdRunCode Application.Run rs![Argument] ' Open a form in Datasheet Mode. Case conCmdOpenFormDatasheet DoCmd.OpenForm rs![Argument], acFormDS ' Any other command is unrecognized. Case Else MsgBox "Unknown option." Compile and save the form. Now you will NOT be able to use the Switchboard Wizard to use this option. The Wizard will only use the 8 pre- defined options. To open a form in Datasheet View you will need to go directly to the Switchboard Items TABLE and add it yourself. If you study the records you will figure out what is going on. Just use the number 9 in the Command field to open a form in datasheet view and showing all records. "NewSysAdmin" wrote: I tried the previous post, and it gave me an error executing the command. By searching another message board, I found this solution. I added the below code to the button which the user would click to open the form in datasheet mode. I put it into an Event Procedure called by the On Click Event. Private Sub Option6_Click() DoCmd.OpenForm "Form Name here", acFormDS End Sub This worked for me, and seemed to be a very simple fix. "Mark Phillipson" wrote: Hi, The way I do it is: Create a Function in a Code Module and run the function from the switchboard (Run Code command). The code would be something like: Public Function OpenMyFormInDSView DoCmd.OpenForm "frmName", acFormDS End Function -- HTH Mark Phillipson Free Add-Ins at; http://mphillipson.users.btopenworld.com/ "kash" wrote in message ... How can I call a form in a Datasheet View using a Switchboard? |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Putting something on the switchboard | Jenn Connors | New Users | 5 | November 5th, 2004 01:38 PM |
Switchboards | Jenn Connors | New Users | 1 | October 30th, 2004 09:48 AM |
closing all forms except main switchboard | gemma charters | Using Forms | 1 | August 22nd, 2004 04:42 PM |
datasheet forms open in form mode from the Switchboard | Paul James | Using Forms | 5 | July 13th, 2004 06:51 AM |