Re: Access CommandButton "On Click" property
From: Matt Williamson (ih8spam_at_spamsux.org)
Date: 03/22/05
- Next message: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Previous message: Steve Schapel: "Re: Access CommandButton "On Click" property"
- In reply to: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Next in thread: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Reply: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Mar 2005 15:38:33 -0500
Steve-
Is there any documentation on the "Documenter" add-in? I can get the data I
want from it, but I have to filter it quite a bit to get just what I want.
I'd prefer to just grab those properties that I need, but I haven't
determined how to get at them yet. Do you have any code examples for doing
so? I've found this example in the archive that get the properties of a
form, but after I've determined that the control is a commandbutton, how do
I get at the properties for the click event?
Sub subExamineAllForms()
Dim db As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document
Dim frm As Form
Dim prp As DAO.Property
Dim ctl As Control
Set db = CurrentDb
Set cnt = db.Containers!Forms
cnt.Documents.Refresh
For Each doc In cnt.Documents
DoCmd.OpenForm doc.Name, acDesign
Set frm = Forms(doc.Name)
Debug.Print "*** Form [" & frm.Name & "]"
For Each prp In frm.Properties
With prp
Debug.Print .Name; " : Type=" & .Type & ", Value=" & .Value
End With
Next prp
'Code I've added here
for each ctl in frm.controls
if frm.controltype = acCommandButton then
'how do I access the properties to get the click event data?
end if
next ctl
DoCmd.Close acForm, frm.Name, acSaveNo
Next doc
Set frm = Nothing
Set cnt = Nothing
Set db = Nothing
End Sub
> I would probably do it manually, just look at the Click event property of
> each command button in the design view of the form, and track it through
> from there.
There are over 100 mdb's, each with 1-20 forms and each form has from 2-40
buttons.. hence, my reasoning for wanting to do this programatically. ;)
TIA
Matt
"Steve Schapel" <schapel@mvps.org.ns> wrote in message
news:ehmfmxxLFHA.4092@tk2msftngp13.phx.gbl...
> Matt,
>
> There are sonme third party utilities that may help with this. For
> example Total Access Alalyzer from www.fmsinc.com . You could also write
> a VBA function to loop through the command button controls on the form and
> write the value of their Click event properties to a table. However, this
> will only give you part of the information you need. If it was mine, I
> would probably do it manually, just look at the Click event property of
> each command button in the design view of the form, and track it through
> from there.
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> Matt Williamson wrote:
>> I have a number of Access 97 Databases that were poorly designed and
>> contain alot of extraneous garbage that needs to be cleaned up. The form
>> UI consists of MANY command buttons, all linked to another form, query or
>> report or event proc that calls any of those 3 through code. What I'd
>> like to accomplish is to determine what each command button is linked to
>> and make a list with the name of the button and what it is linked to. Is
>> this possible programatically from any version of Access or any other
>> way? I have access 97 and 2003 to work with as well as vb6 if I need it.
>>
>> TIA
>>
>> Matt
- Next message: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Previous message: Steve Schapel: "Re: Access CommandButton "On Click" property"
- In reply to: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Next in thread: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Reply: Steve Schapel: "Re: Access CommandButton "On Click" property"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|