[AccessD] Syntax for setting button with event procedure

Darren D darren at activebilling.com.au
Wed Feb 13 17:11:19 CST 2008


Hi Kath

I think it is something like

Forms("strSomeFormNameHere").[Closebutton].OnClick = "[Event Procedure]"

DD
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath Pelletti
Sent: Thursday, 14 February 2008 9:56 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Syntax for setting button with event procedure

Thanks everybody for the advice - nearly there now.....
This did the trick....MyPictureButton.OnClick = "[Event Procedure]"

But I can't remember how to incorporate a variable form name into this line:
If I use the real form name this works:

 Forms!frmrefcountries![Closebutton].OnClick = "[Event Procedure]"

But my form name is strformname which gets passed into the routine.

Two versions which don't work are:

    Forms!strformname![Closebutton].OnClick = "[Event Procedure]"
    Forms![<strformname>]![Closebutton].OnClick = "[Event Procedure]"

Kath



----- Original Message ----- 
From: "Asger Blond" <ab-mi at post3.tele.dk>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Wednesday, February 13, 2008 9:19 PM
Subject: Re: [AccessD] Locking form control - Image control


> To temporarily disable the Click-procedure use:
> MyPictureButton.OnClick = ""
> To reenable the Click-procedure use:
> MyPictureButton.OnClick = "[Event Procedure]"
>
> HTH
> Asger
>
> -----Oprindelig meddelelse-----
> Fra: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] På vegne af Kath Pelletti
> Sendt: 13. februar 2008 05:09
> Til: Access D Normal List
> Emne: [AccessD] Locking form control - Image control
>
> Different problem.....
>
> One of the controls on my form is the 'Add' button which the user clicks 
> to
> add a new record (Image control because I have an icon image for add
> buttons).
>
> The control type is acimage which does not have an enabled or locked
> property.
>
> Is there a way I can temporarily remove it's 'On Click' property so the 
> user
> cannot click and add a new record?
>
> tia
> Kath
> ______________________________________
> Kath Pelletti
> Software Design and Solutions Pty Ltd
> Ph: 9505-6714
> Fax: 9505-6430
> kp at sdsonline.net
> -- 
> 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
>
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.4 - Release Date: 12/02/2008 12:00 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.4 - Release Date: 12/02/2008 12:00 AM
 





More information about the AccessD mailing list