You can only run code directly with F5 if the sub/function does not
have any arguments. If the cursor is positioned in a Sub/Function that
has arguments, or if the cursor is in the empty space between two
procedures, then the macro list pops up. This is the Access standard.
If you want to run a Sub/Function that has arguments, you must do so
in the immediate window (Ctrl+G):
Public MyFunc(intX As Integer) As Integer
MyFunc = 2 * intX
End Function
? MyFunc(3)
6
HTH
Matthias Kläy
--www.kcc.ch
Thanks very much for quick reply. I now am more aware on how F5, F8
works. As it happens the the following procedure doesn't have
arguments and it works properly. But when I try and run it in the
Editor I still get a Macro list. Any ideas?
Option Compare Database
Option Explicit
Public Function faq_Open_Correct_Startup_Form()
'The purpose of this function procedure is to run the
'following sub procedure at startup.
sub_Open_Correct_Startup_Form
End Function