Re: Open a data*** from Switchboard
- From: "kateyliz" <kateyliz@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 5 Aug 2005 06:36:06 -0700
Hi Jeff
Error message when using module "OpenMyForm" is The was an error executing
this command". I copied and pasted your new suggestion in but am still
getting the same problem.
The other method you have suggested - have removed the "!" from the code and
the *** now opens without errors but still as a form view rather than
data*** view!
I am using Access 2003
Thanks again for your help
"Jeff Conrad" wrote:
> "kateyliz" wrote in message:
> news:BA8EC9CC-16FE-4F2C-98DE-D93179296E8B@xxxxxxxxxxxxxxxx
>
> Comments inline....
>
> > Thank you for this. I have now managed to find the command. However, there
> > appears to be an error executing the command.
>
> What exactly is the error message you are receiving?
>
> > I have 9 lines already in my code, so I put yours as "10":
> >
> > Const conCmdGotoSwitchboard = 1
> > Const conCmdOpenFormAdd = 2
> > Const conCmdOpenFormBrowse = 3
> > Const conCmdOpenReport = 4
> > Const conCmdCustomizeSwitchboard = 5
> > Const conCmdExitApplication = 6
> > Const conCmdRunMacro = 7
> > Const conCmdRunCode = 8
> > Const conCmdOpenPage = 9
> > Const conCmdOpenFormData*** = 10
>
> That all looks just fine.
>
> > Also I had some extra code in between at the bottom so I have added mine to
> > it:
> >
> > ' Run code.
> > Case conCmdRunCode
> > Application.Run rs![Argument]
> >
> > ' Open a Data Access Page
> > Case conCmdOpenPage
> > DoCmd.OpenDataAccessPage rs![Argument]
> >
> > ' Open a form in Data*** Mode.
> > Case conCmdOpenFormData***
> > DoCmd.OpenForm rst![Argument], acFormDS
> >
> > ' Any other command is unrecognized.
> > Case Else
> > MsgBox "Unknown option."
> >
> > Are these extra lines of code what are causing my problems?
>
> That all looks pretty good except for one thing.
>
> In the Data*** one you have the recordset as "rst" and in the
> other ones listed you use only "rs" as the recordset. Is it defined
> as rs or rst in your Declarations?
>
> > I also tried entering some code as a seperate function (as per your website)
> > but that was causing an error too...
> >
> > Public Function OpenMyForm(Project_List)
> >
> > DoCmd.OpenForm "frmProject_List", acFormDS
> >
> > End Function
>
> What was the error message?
>
> Try changing that to this:
>
> Public Function OpenMyForm()
>
> DoCmd.OpenForm "frmProject_List", acFormDS
>
> End Function
>
> Run the SBM and select RunCode and then enter
> OpenMyForm on the Function Name line.
>
> > Sorry to sound so dense... I am not au fait with all this programming, so
> > can't see where there may be problems.
>
> Don't worry you are not dense.
> What version of Access are you using by the way?
>
> > Your help is very much appreciated!!
>
> No problem, we'll figure it out.
>
> --
> Jeff Conrad
> Access Junkie - MVP
> http://home.bendbroadband.com/conradsystems/accessjunkie.html
> http://www.access.qbuilt.com/html/articles.html
>
>
>
.
- Follow-Ups:
- Re: Open a data*** from Switchboard
- From: Jeff Conrad
- Re: Open a data*** from Switchboard
- Prev by Date: Re: Should my design be changed??
- Next by Date: Re: Should my design be changed??
- Previous by thread: Should my design be changed??
- Next by thread: Re: Open a data*** from Switchboard
- Index(es):