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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need "RunCommand" 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
 
Do you have some menu items hidden? Because on my Access 2000, Export is number 7.
 
Try using this:

Docmd.RunCommand(command as acCommand)

Its difficult using the menu items because sometimes at run-time the menu wont be selectable -- or certain menu items aren't visible etc...

HirenJ

:eek:)
 
Look up help on DoCmd.TransferDatabase and see if that will do what you need.
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top