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

immediate window not working 1

Status
Not open for further replies.

Apollo13a

Technical User
Apr 27, 2003
277
US
hello, When I try to use my immediate window it doesn't work. I created a public function
Code:
Public Function Test()
Dim x As Integer
x = 4
Test = x
End Function
I called it from the immediate window using
Code:
? Test

and my cursor moves down one line but that's it, no 4. I also tried with a space after the question mark but it didn't make a difference. Any Ideas why my immediate window doesn't respond?
thanks, Jim
 
You didn't tell it to display anything.

Add 'debug.print test' before end function and you should get something.

Doug
 
OK, but I thought that the ? served the same purpose as the debug.print.
I tried it and received an error that says

Compile error
Ambiguous Name Detected:Test
 
My Fault, that error was because of a duplicate function. But, after I got rid of the duplicate function name I tried the debug.print and, still no response from the immediate window. I tried it with and without the ?
Thanks Jim
 
Could it be that this function is placed in a form/reports module? I think the function needs to reside in a standard module (in VBE - Insert | Module) to work like that.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top