Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Joel Elliott   on Jan 18 In MS Office Category.

  
Question Answered By: Hubert Taylor   on Jan 18

I'll put some code  below. I always use Option Explicit,
and since I'm just trying to get a basic setup, I'm not passing
arguments yet. Anyway, I cut everything out of my code for the sake
of trouble shooting--here's my code and the error it generates:

In the Forms folder I have a form  titled ColumnSelection. Here is
its code module:
Option Explicit

Public Sub Hope()
MsgBox "Sweet, you rule!", vbOKOnly
End Sub

Then, in the modules  folder I have a module  titled InputFunctions:
Option Explicit

Public Sub Test()
Call Hope
End Sub

When I run Test, the line that reads "Call Hope" is highlighted and
the error reads:
Complie error:
Sub or Function not defined

As an experiment, I created a new module, Module1, in the modules
folder and copied the code for Hope into it. Then running Test
produces the desired message box. So for some reason, it appears
that code in the Modules folder doesn't have access to code in the
Forms folder.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on accessing user form data from other modules Or get search suggestion and latest updates.


Tagged: