Wizard generated code 
Author Message
 Wizard generated code

I have relied on the Access wizards to code certain functions.  For example,
to save a record, the wizard uses the DoCmd and references a function on the
Access menu like so:

 DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

This seems like a rather restrictive way to code.  It's easy but what
happens when Access is upgraded? Or you want to move your application to the
web?

Does anyone have an example of how I would code the 'save record'  function
entirely  in VBA without referencing the menu?

Thanks
Dave



Thu, 14 Jun 2001 03:00:00 GMT  
 Wizard generated code
Hi David,

I personally don't like the fact that the wizards work off of DoMenuItem...
Access 97 supposedly replaced DoMenuItem with RunCommand constants.  Only
one problem though.... The constants are not documented.

Terry Wickenden has done a lot of work documenting RunCommand constants.
Check out his website.

http://home.clara.net/tkwickenden/

Also, to save the current record, I find it easiest to use the form's Dirty
property.

If me.Dirty then me.Dirty=False

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

:I have relied on the Access wizards to code certain functions.  For
example,
:to save a record, the wizard uses the DoCmd and references a function on
the
:Access menu like so:
:
: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
:
:This seems like a rather restrictive way to code.  It's easy but what
:happens when Access is upgraded? Or you want to move your application to
the
:web?
:
:Does anyone have an example of how I would code the 'save record'  function
:entirely  in VBA without referencing the menu?
:
:Thanks
:Dave
:
:



Thu, 14 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem with Access Wizard-generated code

2. Where is the MDI wizard generated code

3. accessing code generated by visio 2002 database wizard?

4. Running VB code generated by the DTS wizard in .NET

5. Code Example to Produce an Add-In Wizard Like the Database From Wizard

6. Data Adapter Configuration Wizard does not generate Update and Delete

7. VB6.0 Wizard generated master/detail forms give huge problems

8. 32 Bit Program to Unpack myapp.ex_ Files Generated by Wizard

9. Need help in VB wizard generated frmOptions

10. Access: ConnectString generated by the connection wizard fails...

11. Other tool over there Package And Deployment Wizard to generate .C

12. Create custom control in form using code (code wizard adding ocx to form)

 

 
Powered by phpBB® Forum Software