- Local time
- Today, 04:36
- Joined
- Feb 19, 2002
- Messages
- 45,265
Your comparison of converted macro code to code that might be written by a real developer is flawed. No one who knows how to write code would write anything like what you have posted.
I just picked a random sample of bad code. There is no reason to test the same form field multiple times. One test is sufficient.
BAD:
Better:
Plus, that piece of code repeats numerous times along with other code around it. No programmer would EVER do that. The code is repeated in the sample you posted simply because YOU repeated it in the macro. A programmer would use a Do Loop.
If you would stop standing so tall in your ignorance, you might actually learn something. The two code samples above may do the same thing but they are in no way "6 of 1, half dozen of the other" as several posters in this thread might think. Sample 2 IS better no matter what you think.
I understand that recreating your db is a daunting task and I agree that it is not necessary simply to "make it conform to some semblance of good practice". I suspect though that if your partner had any clue what you have done, he would disagree strongly because of the jeopardy to your joint business should you become unable to continue as primary developer.
I can tell by your continued "yes, but" posts that you have no intention of modifying your approach when developing new items. You will continue to do what you have always done, rely on macros and recreate duplicates of all objects. I consider my time to be way too valuable to waste on you any longer.
I just picked a random sample of bad code. There is no reason to test the same form field multiple times. One test is sufficient.
BAD:
Code:
If (Forms!NamesUsed!CountOfParents > 0) Then
DoCmd.RunMacro "ProspectCounter", Forms!NamesUsed!CountOfParents, ""
End If
If (Forms!NamesUsed!CountOfParents > 0) Then
DoCmd.OpenQuery "Query206", acNormal, acEdit
End If
If (Forms!NamesUsed!CountOfParents > 0) Then
DoCmd.OpenQuery "Query207", acNormal, acEdit
End If
Code:
If (Forms!NamesUsed!CountOfParents > 0) Then
DoCmd.RunMacro "ProspectCounter", Forms!NamesUsed!CountOfParents, ""
DoCmd.OpenQuery "Query206", acNormal, acEdit
DoCmd.OpenQuery "Query207", acNormal, acEdit
End If
Plus, that piece of code repeats numerous times along with other code around it. No programmer would EVER do that. The code is repeated in the sample you posted simply because YOU repeated it in the macro. A programmer would use a Do Loop.
If you would stop standing so tall in your ignorance, you might actually learn something. The two code samples above may do the same thing but they are in no way "6 of 1, half dozen of the other" as several posters in this thread might think. Sample 2 IS better no matter what you think.
I understand that recreating your db is a daunting task and I agree that it is not necessary simply to "make it conform to some semblance of good practice". I suspect though that if your partner had any clue what you have done, he would disagree strongly because of the jeopardy to your joint business should you become unable to continue as primary developer.
I can tell by your continued "yes, but" posts that you have no intention of modifying your approach when developing new items. You will continue to do what you have always done, rely on macros and recreate duplicates of all objects. I consider my time to be way too valuable to waste on you any longer.