rsmethurst at UK.EY.COM
rsmethurst at UK.EY.COM
Thu May 13 05:30:20 CDT 2004
Thanks to those who responded I managed to get this to work...
Essentially, what needs to happen is the control needs to have the event
hooked up when it is first programatically designed...
i.e
Set loBtn = CreateControl(strFormName, acCommandButton, acDetail)
With loBtn
.name = "cmdPrint"
.Caption = "Print"
.OnClick = "[Event Procedure]"
End With
Then 'CreateEventProc' will work.
Cheers
Ryan
rsmethurst at uk.ey.com
Sent by: accessd-bounces at databaseadvisors.com
13/05/2004 09:44
Please respond to Access Developers discussion and problem solving
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
cc:
Subject: RE: [AccessD] Saving onClick event procedure
...I wish it was that simple.
We are using code to generate code and all is fine except that the hook up
between the control and it's event is not being saved...
This needs to be done at design time or the object of what we are trying
to do is defeated. (which is to programatically create the events for a
large number of controls across many forms)
Ryan
"John W. Colby" <jwcolby at colbyconsulting.com>
Sent by: accessd-bounces at databaseadvisors.com
12/05/2004 22:55
Please respond to Access Developers discussion and problem solving
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
cc:
Subject: RE: [AccessD] Saving onClick event procedure
why do you need to save it? In the open, just set the property that you
want to hook. That simple.
John W. Colby
www.ColbyConsulting.com
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
rsmethurst at uk.ey.com
Sent: Wednesday, May 12, 2004 9:41 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Saving onClick event procedure
Yes it does Gustav,
The code is also programatically created..
It's now a matter of hooking the event property (onclick) up to the event
procedure...and being able to save it?!
Thanks
Ryan
Gustav Brock <gustav at cactus.dk>
Sent by: accessd-bounces at databaseadvisors.com
12/05/2004 13:44
Please respond to Access Developers discussion and problem solving
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
cc:
Subject: Re: [AccessD] Saving onClick event procedure
Hi Ryan
And does it have some associated code? (which comes from where?)
/gustav
> Yes it has Gustav.
---
> Is the form's HasModule property been set to True?
> /gustav
>> I'm trying to programatically 'hook' an event from a control (on a
form)
>> up to an event procedure.
>> I.e.
>> frm.Form.Controls("optValue").OnClick = "[Event Procedure]"
>> Which works fine, until the form is taken out of 'form view'. I.e. if
I
>> change to design view for the form, or close the form. Once that
happens
>> the on click property is returned to being empty (or unhooked).
>> I've tried saving the form but this seems to make no difference...
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Ernst & Young is proud to sponsor Art of the Garden at Tate Britain (3rd
June - 30th August 2004). This is the first major exhibition to examine
the
relationship of the garden and British art. Advance booking is
recommended.
Information and tickets: www.tate.org.uk/artofthegarden
This e-mail and any attachment are confidential and contain proprietary
information, some or all of which may be legally privileged. It is
intended
solely for the use of the individual or entity to which it is addressed.
If
you are not the intended recipient, please notify the author immediately
by
telephone or by replying to this e-mail, and then delete all copies of the
e-mail on your system. If you are not the intended recipient, you must
not
use, disclose, distribute, copy, print or rely on this e-mail.
Whilst we have taken reasonable precautions to ensure that this e-mail and
any attachment has been checked for viruses, we cannot guarantee that they
are virus free and we cannot accept liability for any damage sustained as
a
result of software viruses. We would advise that you carry out your own
virus checks, especially before opening an attachment.
The UK firm Ernst & Young LLP is a limited liability partnership
registered
in England and Wales with registered number OC300001 and is a member
practice of Ernst & Young Global. A list of members' names is available
for
inspection at 1 More London Place, London, SE1 2AF, the firm's principal
place of business and its registered office.
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Ernst & Young is proud to sponsor Art of the Garden at Tate Britain (3rd
June - 30th August 2004). This is the first major exhibition to examine
the relationship of the garden and British art. Advance booking is
recommended.
Information and tickets: www.tate.org.uk/artofthegarden
This e-mail and any attachment are confidential and contain proprietary
information, some or all of which may be legally privileged. It is
intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient, please notify the
author immediately by telephone or by replying to this e-mail, and then
delete all copies of the e-mail on your system. If you are not the
intended recipient, you must not use, disclose, distribute, copy, print or
rely on this e-mail.
Whilst we have taken reasonable precautions to ensure that this e-mail and
any attachment has been checked for viruses, we cannot guarantee that they
are virus free and we cannot accept liability for any damage sustained as
a result of software viruses. We would advise that you carry out your own
virus checks, especially before opening an attachment.
The UK firm Ernst & Young LLP is a limited liability partnership
registered in England and Wales with registered number OC300001 and is a
member practice of Ernst & Young Global. A list of members' names is
available for inspection at 1 More London Place, London, SE1 2AF, the
firm's principal place of business and its registered office.
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Ernst & Young is proud to sponsor Art of the Garden at Tate Britain (3rd June - 30th August 2004). This is the first major exhibition to examine the relationship of the garden and British art. Advance booking is recommended.
Information and tickets: www.tate.org.uk/artofthegarden
This e-mail and any attachment are confidential and contain proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient, please notify the author immediately by telephone or by replying to this e-mail, and then delete all copies of the e-mail on your system. If you are not the intended recipient, you must not use, disclose, distribute, copy, print or rely on this e-mail.
Whilst we have taken reasonable precautions to ensure that this e-mail and any attachment has been checked for viruses, we cannot guarantee that they are virus free and we cannot accept liability for any damage sustained as a result of software viruses. We would advise that you carry out your own virus checks, especially before opening an attachment.
The UK firm Ernst & Young LLP is a limited liability partnership registered in England and Wales with registered number OC300001 and is a member practice of Ernst & Young Global. A list of members' names is available for inspection at 1 More London Place, London, SE1 2AF, the firm's principal place of business and its registered office.