G
Guest
I have devised some code to verify that certain text boxes are filled in as
required. I have placed the code at the top of the code window, not attached
to any particular control. I think it's called General code or something.
Anyhow, the form is tabbed, and the user can exit from the tab in several
ways. Rather than write the code over and over I have been calling it.
Seems to work, but if anybody has some general information I should know, I'm
glad to hear it. I think it is called a class module, and I think that in
order to call it from another form (although I don't plan to) it would need
to be Public Sub (rather than Private).
Back to the several different ways of exiting: one way is to print a report
based on the information entered, another is to send an e-mail requesting the
next person to view the record in the database, etc. In any case, if a
control is empty a message informs the user that all fields must be filled
in, and places the cursor (set focus) in one of the empty controls. If the
user fills in the missing information and then clicks, say, the e-mail button
again, the message about missing information appears again. Clicking OK to
the message brings up the e-mail (sendObject) as intended. I can avoid the
error message by clicking outside of the field, but cannot figure out how to
accomplish the equivalent with VBA.
Also, as I have mentioned I can call the code at command button click
events, but would also like to call it when clicking on the next tab. I
can't seem to assign it to a click event of the tab (or what seems to be the
click event). I can assign it to the first control in the tab order for that
tab (two different senses of tab here, I know), but I wonder if there is
another way.
required. I have placed the code at the top of the code window, not attached
to any particular control. I think it's called General code or something.
Anyhow, the form is tabbed, and the user can exit from the tab in several
ways. Rather than write the code over and over I have been calling it.
Seems to work, but if anybody has some general information I should know, I'm
glad to hear it. I think it is called a class module, and I think that in
order to call it from another form (although I don't plan to) it would need
to be Public Sub (rather than Private).
Back to the several different ways of exiting: one way is to print a report
based on the information entered, another is to send an e-mail requesting the
next person to view the record in the database, etc. In any case, if a
control is empty a message informs the user that all fields must be filled
in, and places the cursor (set focus) in one of the empty controls. If the
user fills in the missing information and then clicks, say, the e-mail button
again, the message about missing information appears again. Clicking OK to
the message brings up the e-mail (sendObject) as intended. I can avoid the
error message by clicking outside of the field, but cannot figure out how to
accomplish the equivalent with VBA.
Also, as I have mentioned I can call the code at command button click
events, but would also like to call it when clicking on the next tab. I
can't seem to assign it to a click event of the tab (or what seems to be the
click event). I can assign it to the first control in the tab order for that
tab (two different senses of tab here, I know), but I wonder if there is
another way.