You've explained "how", as in "how you want to accomplish something" (call
click event in another form)...
If you'll provide a bit more specific information about "why" (as in "what
would having the ability to do this allow you/your users to accomplish"),
folks here may be able to offer more specific suggestions.
Regards
Jeff Boyce
Microsoft Office/Access MVP
- Show quoted text -
TJ:
I won't ask you why you want to do this. I'll tell you that when I
have needed to share code among forms, I write that code in a
Module.
So Module1 may have a function similar to this in it.
Public Function MakeMySqlString( p1 as string ) as string
Dim s as string
s = "SELECT .... "
MakeMySqlString = s
end function
Back in the individual forms, I code:
Private sub cmdFilter_Click()
Dim param1 as string
Dim sReturn as string
param1 = "x"
sReturn = Module1.MakeMySqlString( param1 )
end sub
I write the same type of function call in the other form.
Private sub cmdSelect_Click()
Dim param1 as string
Dim sReturn as string
param1 = "x"
sReturn = Module1.MakeMySqlString( param1 )
end sub