Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a "Runcommand" or DoMenuItem Ghuru !!!!!

Status
Not open for further replies.

Paul7905

MIS
Jun 29, 2000
205
US
Scenario ~

I am Using Access 2000.

Looking for a way to bring up the Access Export window using VBA.

In help, I found the "DoMenuItem" command.

Reading Help, this command was available in earlier versions of Access but has been replaced by the "RunCommand" argument.

Unfortunately, I cannot figure out what replaces the DoMenuItem in the Runcommand options.

So, in desparation, I coded the following as a test of the DoMenuItem command:

Private Sub Form_Load()
DoCmd.OpenQuery "ScanArchiveAdjSub"
DoCmd.DoMenuItem acFormBar, acFile, 5, , acMenuVer20
End Sub

The code bring up the "save as" menu option of the File menu ok but i cannot figure out how to get it to bring up the "Export" option on the file menu.

Export is number 5 in the drop down list but somehow it is getting save as which is number 4.

Does anyone know how i can get this to bring up the Export or what the "RunCommand" equivalent in Access2000 is??

Thanks

PJD
 
This does not answer your question exactly

docmd.outputto will export the data to which ever application is the most appropriate

Jason
 
There is no RunCommand equivalent to DoMenuItem. The problem with DoMenuItem was that it was version dependent; RunCommand was created in order to eliminate this dependency.

I believe your only recourse is to use SendKeys to send Alt-F E keystrokes to Access:
SendKeys "%FE"
SendKeys is a last resort solution, because it can be unreliable, but if you're trying to open the Export dialog box for the user to fill in, it's probably your only choice.

(If it isn't really necessary to leave the dialog open for the user, you could use DoCmd.OutputTo instead.) Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top