Macro vs Code

Graybeard

Registered User.
Local time
Today, 12:49
Joined
Aug 7, 2004
Messages
64
I know that most here are down on macros and prefer code. I have started learning code and using code instead of code. However, I have a question. I have a popup form that allows the user to record the details of a customer phone call. I want the user to popup the form at anytime whenever they get a call. Instead of coding the docmd repeatedly would it not make more sense to write a openform macro and then just use the macro throughout the database? this seems to be one instance when a macro is more efficient. Am I wrong?
 
this is where sub routines come into play.

Damn you rich, I hit the submit button first.. pfffft!
 
I've worked with subroutines in terms of form commands and have even managed to learn some interesting tricks with the help of some of the people here. For example, I have written code that opens a form, populates a field with garbage then immediately sets the field back to null. The purpose is force my customer id field to populate as soon as new customer record is opened.(For reasons unique to the business the id number has to be displayed ). However, I have yet to work with functions and am not sure how to do what you suggest. Can you post an example or point me somewhere where I can learn how to do it?
 
In this case cheat, create the macro then use the wizard to convert it to vba
 

Users who are viewing this thread

Back
Top Bottom