English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-11-12 13:28:42 · 6 answers · asked by societyfalls 1 in Computers & Internet Programming & Design

Thanks, I tried to use the macro before I posted, but no code populated.

2007-11-12 13:41:24 · update #1

The sendkey way should be doable for the user...but i'm still curious what the vba for it is. Thanks for the response

2007-11-12 13:55:41 · update #2

6 answers

do 'tools' > 'macro' > 'record new macro' in an office application then open the vba editor. stop it recording, and view if it's saved the code you need. transfer the code et voila.

but obviously the most basic way would be to use the sendkeys command to send alt+f11 to open it:
SendKeys "%{F11}"

EDIT:
the vba to open it the 'proper' way will probably lie behind one of the below bits of code - probably the second one because that is what deals with calls to vb editor stuff:
application.goto
application.vbe.

application.vbe. is incomplete, it's only a starting point. you'd need to have a read through the properties that are available when you hit the '.' at the end to see which one(s) might open the editor - i don't have access installed at the oment so i can't be more precise.

2007-11-12 13:33:07 · answer #1 · answered by piquet 7 · 0 1

Ms Access Vba Code

2016-12-14 13:51:46 · answer #2 · answered by whiten 4 · 0 0

A convenient way to get to a code window -- which I often do -- is to create a new form and put a Command Button on it.

Then, in the Property Sheet for the Command Button, go to the Event tab and select Event Procedure for the OnClick event. Double-Click the Build icon (the three dots) at the right of the property to open the code window.

Now you can write and run whatever code you desire, and make whatever changes you need -- all without ever saving the form (unless you want to save it).

You can also open the Immediate Window (aka Debug Window) by pressing Ctrl-G.

§

2007-11-12 13:56:12 · answer #3 · answered by BlueFeather 6 · 0 1

DoCmd.RunCommand acCmdNewObjectModule

This opens a new Module with the Name "Module1" (the default name for all new VBA modules).

Alternatively:
Save A VBA Module as "NewCODE", then use :

DoCmd.OpenModule "NewCODE"

This opens the Module "NewCode" in the VBA Editor. Put some instructions about "Saving As" so the module "NewCODE" stays blank.

Or replace "NewCODE" with a specific module name if You want them to Open a specific Module.

2007-11-13 04:59:36 · answer #4 · answered by Capt Crasher 6 · 0 0

Hi,
U open ur MS-Access database and press Alt-F11, VBA will open. Now u can insert a Module then Procedure and do ur work.

2007-11-12 15:28:20 · answer #5 · answered by iqbal 4 · 0 1

DoCmd.OpenModule "[Module Name]","[Procedure Name]"

2016-06-22 04:24:36 · answer #6 · answered by davidcc500 1 · 0 0

fedest.com, questions and answers