Betreft: Re: TNXS Solution: [AccessD] Programmaticly fill control events

marcel.vreuls at achmea.nl marcel.vreuls at achmea.nl
Mon Feb 24 07:28:00 CST 2003


:-)




"Stuart Sanders" <stuart at pacific.net.hk>@databaseadvisors.com op 24-02-2003
14:05:11

Antwoord aub aan accessd at databaseadvisors.com

Verzonden door:     accessd-admin at databaseadvisors.com


Aan:  <accessd at databaseadvisors.com>
cc:

Onderwerp:     Re: TNXS Solution: [AccessD] Programmaticly fill control
      events



hehe ... don't forget to remove the Hello World msgbox from the sample I
provided.

----- Original Message -----
From: <marcel.vreuls at achmea.nl>
To: <accessd at databaseadvisors.com>
Sent: Monday, February 24, 2003 8:05 PM
Subject: TNXS Solution: [AccessD] Programmaticly fill control events


>
> Hi Group,
>
> In all replies I received on my question I copied the parts I thought I
> could use. Further more some existing code fo mine. I made this function.
> perhaps someone else can use this as well :-). Many thanks to all. This
> saves me about 2000 mouse clicks en several hours of dumb work!!!!
>
>
> Grtz. marcel
>
>
> Sub fncAddFunctionality(frm As Form)
> 'Function: Add generic code behind a control
> 'Specials: -change the event, standard to click
> '        : -change/add insertlines to desired code
> '        : -add more controltypes in the IF-then statement.
> '       : - next to code you can also set custom properties of the
control
like height, font, etc.
>     'All possible controltypes.
>     'acLabel Label
>     'acRectangle Rechthoek
>     'acLine Lijn
>     'acImage Figuur
>     'acCommandButton Opdrachtknop
>     'acOptionButton Keuzerondje
>     'acCheckBox Selectievakje
>     'acOptionGroup Groepsvak
>     'acBoundObjectFrame  Kader voor afhankelijk object
>     'acTextBox Tekstvak
>     'acListBox Keuzelijst
>     'acComboBox  Keuzelijst met invoervak
>     'acSubform Subformulier / subrapport
>     'acObjectFrame   Kader voor niet-afhankelijk object of grafiek
>     'acPageBreak pagina - einde
>     'acPage  Page-object (pagina in tabbesturingselement)
>     'acCustomControl ActiveX-besturingselement (aangepast
besturingselement)
>     'acToggleButton Wisselknop
>     'acTabCtl Tabblad '
>
>     Dim ctl As Control
>     Dim lngLine As Long
>
>     DoCmd.OpenForm frm.Name, acDesign, , , , acHidden
>
>     'Elementen in Controls-collectie opsommen.
>     For Each ctl In frm.Controls
>         ' Controleren of besturingselement een tekstvak is.
>         If ctl.ControlType = acCommandButton Then
>             ' Eigenschappen besturingselement instellen.
>             With ctl
>                ' .Enabled = True
>                ' .Height = 400
>                ' .SpecialEffect = 0
>             End With
>             lngLine = frm.Module.CreateEventProc("Click", ctl.Name)
>             With frm.Module
>                 .InsertLines lngLine + 1, "' Purpose: commentline for
this
code"
>                 .InsertLines lngLine + 2, "On Error Resume Next"
>                 .InsertLines lngLine + 3, vbTab & "msgbox ""Hello
World"""
>             End With
>         End If
>     Next ctl
>
>     DoCmd.Save acForm, frm.Name
>     DoCmd.Close acForm, frm.Name
> End Sub
>
>
>
>
> ********************* DISCLAIMER *********************
> De informatie in dit e-mail bericht is uitsluitend
> bestemd voor de geadresseerde. Verstrekking aan
> en gebruik door anderen is niet toegestaan.
> Door de electronische verzending van het bericht
> kunnen er geen rechten worden ontleend aan de
> informatie.
> ************************************************************
>
> _______________________________________________
> 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


*****************************************************************
Dit bericht is bij binnenkomst gecontroleerd op de
aanwezigheid van virussen. Er zijn geen (bekende)
virussen gevonden.  Active
*****************************************************************






********************* DISCLAIMER *********************
De informatie in dit e-mail bericht is uitsluitend
bestemd voor de geadresseerde. Verstrekking aan
en gebruik door anderen is niet toegestaan.
Door de electronische verzending van het bericht
kunnen er geen rechten worden ontleend aan de
informatie.
************************************************************




More information about the AccessD mailing list