View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Clayman Clayman is offline
external usenet poster
 
Posts: 95
Default Public Variable - not defined?

That's going to happen once we decide exactly where all this will reside. For
development purposes I'm using the drive letter.

--
Adios,
Clay Harryman


"Jim Thomlinson" wrote:

A couple of things...
1. When in doubt try being more specific in your referencing
msgbox Module1.findvacdb
2. All users ultimately have the same path to the file. They may have
different drive letters but you can use the full URL. For example your S
drive is mapped something like \\Myserver\Something

In windows explorer you will see the full path besid ethe drive letter or in
Tools - map directory
--
HTH...

Jim Thomlinson


"Clayman" wrote:

No. But, I do have a few "Exit Sub" in error-handlers. Would these have the
same effect?

I don't know if it matters, and didn't think about mentioning it before. The
code in Module 1 fills a ComboBox on a form (employee numbers). Selecting an
item in the ComboBox executes the next set of code - which is where I'm told
the variable is not defined.

The variable is the path to my database which may differ depending upon the
user.
--
Adios,
Clay Harryman


"Jim Thomlinson" wrote:

Do you use the stand alone line of code

End

That line of code kills everything including clearing all global variables.
--
HTH...

Jim Thomlinson


"Clayman" wrote:

I apologize if this got double-posted. I think I need to go home and take a
nap rather than continue to foul this computer up anymore today with my
presence. :P

--

I need "findvacdb" to be the same across my entire project so I defined it
in "This Workbook" as Public:

Option Explicit
Public findvacdb As String

Private Sub Workbook_Open()
.
.
findvacdb=S:\Path\to\mdb

When I try to use it in a form, I get the error "Variable not defined".

I'm tired and I just had a big lunch. Maybe it's the hamburger killing brain
cells. But I can't figure this out.

If you need more code, let me know.

Thanks!
--
Adios,
Clay Harryman