Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

openmodule question

Status
Not open for further replies.

calahans

Programmer
Jun 14, 1999
348
IE
Hi,<br>
<br>
I have inherited an application written using Access with an Oracle backend. I write using VB normally so I know VBA. The person who wrote this used macros and queries i.e one macro calls ten queries which use make tables... you get the idea (waking nightmare)<br>
<br>
I had to replace one query with some ADO code to increase performance (from 3 hours to 2 mins!!!). HOwever I'm trying to put my code into a macro. I use the OpenModule and give the routine name. It runs fine, but it actually opens the module window. I don't want the users to see the code - how can I supress the window opening??<br>
<br>
Thanks,<br>
<br>
C
 
From your macro; use the RunCode action rather than OpenModule. That should do the trick. Keep in mind that you can only execute Functions, not SubRoutines.<br>
<br>
Gook Lcuk!
 
Rather than put your code in a macro, did you know that Access has a utility to convert macros to code. Just select the macro and use File¦SaveAs/Export¦Save as VB module...
 
In VBA code, I am dynamically building a form adding all of the controls. As part of this process, I also needed to add VBA code to this dynamic form. I'm able to add the code but prior to adding the VBA code, I need to delete all existing code on the form.

The following code is used to delete the existing code on the dynamic form:

DoCmd.OpenModule "Form_frmLabelMaintenance_sf"
Set mdl = Modules("Form_frmLabelMaintenance_sf")
mdl.DeleteLines 1, mdl.CountOfLines
DoCmd.Close acModule, "Form_frmLabelMaintenance_sf", acSaveYes

The above works but the code window remains open.

How do I close the code window programatically?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top