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

Lightweight or Code?

Status
Not open for further replies.

georgp

Technical User
Mar 28, 2002
96
US
Hi,

if I recall correctly, I have seen people saying in various unrelated threads that light weight forms (i.e. put everything into the property box) work better than those with VBA code behind, but others say the opposite, such as Bill P.
I really wonder which is better, or if one or the other should be avoided. Actually I do both (without any real system behind) and I encounter a problem (see my thread Form rocks...) which may be related to this.

I would appreciate any comment.

georgp
 
Hi geo,

Depends on your interpretation of 'better'.

In general, professional programmers will always code with a view to future maintenance.

Using VBA code allows for commenting, and allows for modularity and re-usable code.
This makes it more efficient and more easily maintained.

Anyone who knows VBA will understand properly developed code and it's meaning (comments help this).

In general, all functions within a MS Access form without VBA will be contained within macros. Macros are pretty well untraceable (in a debugging sense), and documentation doesn't help in the understanding of the process flow.
Macros create a mish-mash - with no obvious process flow.

What you have heard, is that placing control of data as high as possible in the structure - reduces the need for duplication.
(You can restrict certain entries at table/field-level design) - this negates the need for checking a field on 50 diferent forms.

Design your db app, then look at the fields in that DB - define their probable values and restrict them at that level.

Properties: define them at db level if poss, further restrict them at form or code level - code level is reqd. if the properties change dynamically.

My view only, others will probably argue,

ATB

Darrylle


"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
At least one 'learned' writer has written an article "At least three ways to do anything" on MS Access. It does not even refer to Macros. And yet I think it is, at best, a minimilazation of the capability built into VBA. My personal 'preference' is along the lines of placing minimal code in the forms modules, but to use VBA to do most of the 'computational' work. Form and Control properties are, in my opinion, insufficient to construct robust applications, unless you consider that using them to call VBA procedures as 'just usung the properties.

Confused yet?




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top