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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top