- Joined
- Nov 15, 2007
- Messages
- 1
- Reaction score
- 0
Hello Guys. I am new over here. I would like to ask you something about macros in access.
I am trying to do a simple thing but I can not as I have never done it before.
I want:
Before my database starts (before form, switchboard etc appear), to check some logical situations and then to start. If the result is false, then quit.
I know that my code is corrected because I tried it in Visual Basic.
The problem is that I do not actually know how to do this. I beliebe, I have to make a macro, a RunCode macro..but I do not know what to tell it in Function Name in order to run my code. I alsp do not know where to put my code.
As I was trying I have done this:
I found that I have to first create a module.I create a module with a chosen name, and then I wrote (after the line "Option Compare Database") Function Test. After this I wrote the code and then I wrote End Function. I saved this function as AccTest.
I made a RunCode macro and in the function name I wrote [Test], or [AccTest]![Test] but both expressions caused an error msg (when I tried to run the macrio), saying that Microsoft can not find this expression.
What I am doing wrong? How can I run the procedure/function I want ? Is there a different way to run my code in startup without macros, modules ? I am using Office 2007.
Please if you know help me.
Thanks in advanced.
I am trying to do a simple thing but I can not as I have never done it before.
I want:
Before my database starts (before form, switchboard etc appear), to check some logical situations and then to start. If the result is false, then quit.
I know that my code is corrected because I tried it in Visual Basic.
The problem is that I do not actually know how to do this. I beliebe, I have to make a macro, a RunCode macro..but I do not know what to tell it in Function Name in order to run my code. I alsp do not know where to put my code.
As I was trying I have done this:
I found that I have to first create a module.I create a module with a chosen name, and then I wrote (after the line "Option Compare Database") Function Test. After this I wrote the code and then I wrote End Function. I saved this function as AccTest.
I made a RunCode macro and in the function name I wrote [Test], or [AccTest]![Test] but both expressions caused an error msg (when I tried to run the macrio), saying that Microsoft can not find this expression.
What I am doing wrong? How can I run the procedure/function I want ? Is there a different way to run my code in startup without macros, modules ? I am using Office 2007.
Please if you know help me.
Thanks in advanced.