VBA equivalent of F9 or shift+enter?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have very limited experience with Access VB, so this is probably a very
easy question. I just can't seem to find anything in Help.

I have a button on a form that runs a query. However, the query will fail
unless the active record in the form is saved first. Rather than try to
explain to users that they have to hit shift+enter before clicking the
button, I want a line of code that will do it for them. I suspect that it
will have something to do with the CurrentRecord property, but I've had no
luck with the following:

CurrentRecord.Save
Me.CurrentRecord.Save
DoCmd.Save(acForm,CurrentRecord)
DoCmd.Save(acForm,Me.CurrentRecord)
DoCmd.Save

If anyone can let me know if I'm on the right track, I'd really appreciate
it. I don't have any sort of reference other than Access Help. Access 2000,
XPPro SP2.

Thanks a million.
 
Assuming that you want to save the data in the form that is running the
code, this is the most common way to do that:

Me.Dirty = False
 
Ken,
That did the trick. Thanks for the help.

--
Mike Lee
McKinney,TX USA


Ken Snell (MVP) said:
Assuming that you want to save the data in the form that is running the
code, this is the most common way to do that:

Me.Dirty = False
 

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

Similar Threads


Back
Top