Invalid use of Me keyword error

  • Thread starter Thread starter Tcs
  • Start date Start date
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
 
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
 
Either omit everything after acForm (the default is the currently open
Form) or omit "Me.". To say "Me.frmProgressBar" when frmProgressBar is
the currently open Form is like saying Me.Me!

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


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top