Run macro from VB

J

Jason Frazer

I have a button with and EVENT PROCEDURE. How can run a
macro that is in my data base in my VB code? the macro
name in Access is REFRESS DATE. This macro basically
refreshes the data before it goes to a print preview.
I would just refresh the data in VB but i don't know how.
Could you please help me try it both ways so i can judge
which i like better.

Thanks for you time and help
 
J

Jeremiah Ellison

I don't really understand your meaning of "refresh the data", do you mean save the current record?
Depending on your Access version, you can save the current record by using one of the following:
Me.Refresh
Or
Me.Dirty = False

You can also use DoCmd.RunMacro to run a macro.

I have a button with and EVENT PROCEDURE. How can run a
macro that is in my data base in my VB code? the macro
name in Access is REFRESS DATE. This macro basically
refreshes the data before it goes to a print preview.
I would just refresh the data in VB but i don't know how.
Could you please help me try it both ways so i can judge
which i like better.

Thanks for you time and help

Jeremiah Ellison
Ellison Enterprises - Your One Stop IT Experts
 
V

Van T. Dinh

Check Access VB Help on the RunMacro Method of the DoCmd Object. The code
you need should be something like:

DoCmd.RunMacro "REFRESH DATE"

(or "REFRESS DATE"???)
 

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

Top