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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't run my first attempt at VBA module! 3

Status
Not open for further replies.

twench

Technical User
Feb 16, 2005
5
GB
I've been building small databases using Access '97 for a while now and have decided it's about time I learned some Visual Basic. I've typed in a piece of code from a tutorial into a new module but the wretched thing won't 'Run' - it won't even give me the option. So I am stuck with code that has been checked a hundred times and debugged but can't actually be tested. I'm sure it's something painfully obvious but I'm damned if I can figure it out. Please enlighten me!
 
Please enlighten me
About WHAT ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You will need to create a Macro or attach it to a control on a Form to run your code. VB can not be run from the VB module window.
 
Actually, you can run some VBA code from the VB module window. Select Run from the menu and choose Run Macro or just hit F5. The trick is, your cursor must be within the sub or function you want to run and the code cannot require any parameters.
 
Thanks MoLaker - I never knew that even after 7 years of Access VBA. Always good to learn something new.
 
I do most of my runtime testing by typing commands in the immediate window.

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top