In the Database window (where you select what object type you want to 
work with), select the "Modules" object type.  This will clear the 
frame on the right side of the window.  Select "New" from the toolbar 
at the top of the window.  This will open the "unbound" module I 
mentioned earlier.  Type the COMMON code (that you want all forms to 
have) in here, and make sure you use the word "PUBLIC" instead 
of "PRIVATE" as the first word when you are writing your procedures.  
Then you can reference the procedures from the bound modules 
(forms).  To make sure you reference the correct procedure, it is a 
good idea to reference the standard module's name in front of each 
procedure.  In the example below, the module is called "basPublic", 
and is explicitly referenced to make sure the computer can find the 
code.  If you do it this way, you can have multiple, public routines 
with the same names - as long as you reference the module name in 
front of the procedure name.  "bas" at the beginning of the module 
name is a standard abbreviation representing code modules.

in the form's module, you would put something like this:

===============

Private Sub cmdPrevious_Click()
CALL basPublic.PreviousRecordClick()
End Sub

Private Sub cmdNext_Click()
CALL basPublic.NextRecordClick()
End Sub

Private Sub cmdEOF_Click()
CALL basPublic.EOFClick()
End Sub

Private Sub cmdBOF_Click()
CALL basPublic.BOFClick()
End Sub

Private Sub cmdNew_Click()
CALL basPublic.NewClick()
End Sub
==========================

where the names "PreviousRecordClick()", "NextRecordClick
()", "EOFClick()", "BOFClick()", and "NewClick" are the PUBLIC 
routines from your UNBOUND module (in the "Modules" section of the 
datbase).  "EOF" and "BOF" are standard abbreviations, 
representing "End Of File" and "Beginning Of File", respectively.

Hope this helps!

Alienwebmaster

--- In [email protected], "John" 
<[EMAIL PROTECTED]> wrote:
>
> Thanks for your answer.
> That's what I had in mind, but can you give me an example of how to 
do 
> it.
> 
> I've tried a few different methods, but none seem to work jsut 
right.
> 
> Thanks again.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessVBACentral/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to