Hi, Mark.
> How do I call a sub procedure from a different form?
Ensure that the other form is currently open and that the procedure is
public. Then call it from any other VBA code module with syntax such as the
following:
Forms!FormA.ProcedureName
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
> Hello All,
>
[quoted text clipped - 6 lines]
> I know there are a few work around, like putting the code behind a txbox
> then having it run on set focus, but I would prefer not to go this route.
'69 Camaro - 08 Mar 2007 21:52 GMT
Hi, Mark.
> Here is what I tried.
>
[quoted text clipped - 5 lines]
>
> Both gave errors.
If the error message was "I've fallen and I can't get up," then say a prayer
and bury your database in a deep hole when it stops breathing. However, if
the error message was one of the other thousands of possibilities, then we
can probably help you troubleshoot what's wrong if you're willing to share
that secret message with us and post the declaration of your VBA procedure
that is being called.
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
> Hi, Mark.
>
[quoted text clipped - 26 lines]
>> I know there are a few work around, like putting the code behind a txbox
>> then having it run on set focus, but I would prefer not to go this route.
Mark - 09 Mar 2007 14:01 GMT
I thought maybe would could make a game out of it. Maybe call it guess the
error. :)
I posted the post below before I read your post about making the procedure
public. Once I change it to public it worked fine.
Thanks!
> Hi, Mark.
>
[quoted text clipped - 54 lines]
> >> I know there are a few work around, like putting the code behind a txbox
> >> then having it run on set focus, but I would prefer not to go this route.
'69 Camaro - 09 Mar 2007 17:08 GMT
Hi, Mark.
> I thought maybe would could make a game out of it. Maybe call it guess
> the
> error. :)
We play that game a lot around here. Some of us are fairly good at it!
> I posted the post below before I read your post about making the procedure
> public.
I suspect that means that next time you see a post written by '69 Camaro,
you'll make a point of reading it -- just in case it has some helpful info.
:-)
> Thanks!
You're welcome! Glad it helped!
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
>I thought maybe would could make a game out of it. Maybe call it guess the
> error. :)
[quoted text clipped - 73 lines]
>> >> then having it run on set focus, but I would prefer not to go this
>> >> route.