Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    Join Date
    Mar 2004
    Posts
    660

    Unanswered: Run function in switchboard manager

    I have a function that was written in module. Can i run the module in switchboard manager? I tried to use run function and give the function name. it didn't work. Thanks for your help.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by yyu
    I have a function that was written in module. Can i run the module in switchboard manager? I tried to use run function and give the function name. it didn't work. Thanks for your help.
    You selected "Run Code" and then entered the function name in the box Run Function? How did it "not work?" Did you get an error or what? What exactly was this function supposed to do?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Isn't it "Call" functionname. ie...

    call MyFunctionName
    or
    call MyFunctionName(VariableToPass)
    etc...etc...
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Not when you're using the Switchboard Manager, Paul. I only know because I've played with it a little when posters ask questions about it. I avoid them like the plague, they're so restrictive, and usually try to steer people to use a form with buttons, but it depends on the skill level of the poster. In the Switchboard Manager you select "Run Code" and then simply enter the function name in the Run Function box. If he did this and didn't get an error message I'm guessing maybe a mispelled function name?

    Linq
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Aaahhh. I recall now. Thanks for correcting me. It's been a long time since I've worked with Macros and the Switchboard. I never use the switchboard (detest it) and very rarely, rarely will use a Macro. Everything's in code. Thanks again for steering me right directions. You're probably right about the misspelling. I'll head out to some other posts I can answer and leave you guys at it. Chat with ya later Missinglinq.
    Last edited by pkstormy; 08-15-07 at 14:58.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Anything you can create in a macro can be written in VBA; and guess what... You can add error handling to your code (oh joy of joys!).

    The easiest way to see this is to right click on any macro and hit "Save as..." then select module from the combobox and job's a good'un!
    George
    Home | Blog

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Exactly, george! On the forum I moderate, the macro questions are the hardest to get answered simply because none of the members who answer questions routinely ever use macros, with the occasional exception of the AutoExec and AutoKeys!

    Linq
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    Join Date
    Mar 2004
    Posts
    660
    Thanks everybody. I have module named "Deposit" It will export the query to excel. I can run the module. But in swtichboard manager, i used run code, use "Deposit" as the function name. When i open switchboard. There is error message : there was an error executing the command.
    Thanks again!

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Try Deposit() *shrug*
    George
    Home | Blog

  10. #10
    Join Date
    Mar 2004
    Posts
    660
    I did try both, Deposit and Deposit(). But they all didn't work. Anything else i can try? Thanks.

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by yyu
    Anything else i can try?
    The help files?
    George
    Home | Blog

  12. #12
    Join Date
    Mar 2004
    Posts
    660
    still haven't figure out. i check the source code. When it run code, it go to HandleButtonClick_Err.

    Another question please, i have search form. It will base on searching by receipt date, by receipt from or by receipt company.I can create search form and using only one query. Then in the source code. i can change the criteria. What about created in swtichboard manager. Is it possible? Thanks.

  13. #13
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Why would you use the Switchboard manager to make a search form?
    Ryan
    My Blog

  14. #14
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by yyu
    I have module named "Deposit" It will export the query to excel. I can run the module. But in swtichboard manager, i used run code, use "Deposit" as the function name. When i open switchboard. There is error message : there was an error executing the command.
    Two questions:

    Exactly what is it that you're now referring to above as a "module?"

    Are you now saying that the error comes when you open the switchboard, as opposed to when you click on a switchboard button?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  15. #15
    Join Date
    Mar 2004
    Posts
    660
    When i open the switchboard then click the button, it gave the error message, there was error exceuting the command. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •