Invalid use of Me keyword error

T

Tcs

I'm trying to close my form. The code I'm using is:

DoCmd.Close acForm, Me.frmProgressBar

VBA (Access 2k) doesn't like it. When I try to compile it, I get the error.
What *should* I use?

Thanks in advance,

Tom
 
G

Gerald Stanley

If you are running this code from within frmProgressBar, then you should use
DoCmd.Close acForm, Me.Name

Otherwise

DoCmd.Close acForm, "frmProgressBar"

Hope This Helps
Gerald Stanley MCSD
 
Top