Run macro from VB

  • Thread starter Thread starter Jason Frazer
  • Start date Start date
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
 
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
 
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"???)
 
Back
Top