View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Public Variable - not defined?

Try putting this line in a general module.

Public findvacdb As String

(delete then line within the ThisWorkbook module)

or

refer to that variable by its fully qualified name:
msgbox ThisWorkbook.findvacdb





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


--

Dave Peterson