Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2006, 07:27 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts
Default Problems executing code

Hi,

Access 2003

I've created code within an Access form's Build Event (nothing tricky)
and found that although I am able to run it from an Access Object (Command Button), I can't execute it from within the VBA environment. I have found this problem ages ago but can't remember the solution....

I think it may be adjusting the Tools/References selection list or a setting within Security.

Can anyone please help?

Neal

A Northern Soul
__________________
Neal

A Northern Soul
 
Old December 11th, 2006, 04:07 AM
Registered User
 
Join Date: Nov 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to GolferGuy
Default

The code that is associated with a form is only executable when the form itself is open. Generally, you can only execute the code with a button or event on the form. Therefore, the code is NOT available to be executed from within the VBA envireonment. The only way to do that would be to make sure the procedure you want/need to run is Public (not private) and then (I believe) the code is something like: Forms!frmWithCode.FunctionName(AnyParmsNeeded). Of course you will need to put your own names in place of "rmWithCode" and FunctionName. Plus, if any parameter are required, put the correct parameters in place of AnyParmsNeeded.
Hope this helps,


Vic





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP code not executing nsingh ASP.NET 1.0 and 1.1 Basics 1 October 22nd, 2008 02:45 PM
Problem executing code lagyossarian ASP.NET 2.0 Basics 0 April 20th, 2006 01:34 PM
Problem on executing code on server!! mkmaurya_it General .NET 0 February 11th, 2005 07:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.