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

how do I decipher this line of cod

Status
Not open for further replies.

tbiceps

IS-IT--Management
Joined
Nov 23, 2005
Messages
106
Location
US
Can someone explain to me where I can find information on how to decipher VBA code. For instance, I want to breakdown what each parameter in the code listed below means?


DoCmd.DoMenuItem acFormBar, acRecords Menu, 5, , acMenuVer70
 
Since this is an Access question, perhaps better post in one of the seven fora dedicated Access (see the forum search at the top of the page) - perhaps Access other topics (forum181)?

The method you're showing, is deprecated, and replaced by the DoCmd.RunCommand - to decipher it - well, except for the typo (acRecords Menu in stead of acRecordsMenu). I think it's supposed to execute the fifth command on the records menu when in form view of a form (aka save, if it hasn't changed since then).

An analogue for that with more recent versions (at least Access 97 and newer), would be

[tt]docmd.runcommand accmdsaverecord[/tt]

Funny stuff, is that the wizards of the later versions still produces that stuff ... (btw - if you type docmd.menuitem - and then a space, you'll get some controltip guiding you to at least what the different arguements are about.

Roy-Vidar
 
Thank you. Why wouldn't this question be a VBA post? I'm attempting to use your great information to code a command button in the visual basic editor window. This does represent code created by the wizard.
 
It is indeed a VBA question, but this is not a VBA forum - it is a VB/Databases forum - how to connect to, and work with different (Microsoft) databases from VB (not VBA).

VB does not have a DoCmd object, it belongs to the Access appliaction object;-)

VBA questions are better dealt with in fora dedicated that technology - for pure VBA forum707 (office) forum705 (Access VBA), but for instance coding relevant to Access forms, which this is, is better placed in for instance the Access Forms forum (forum702) ...

Roy-Vidar
 
To add to Roy's comment...

When you post your question in the approriate forum, you have a better chance of getting the right advice in a more timely fashion.

There are many forums here at tek-tips. I encourage you to browse through this list.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top