Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2006

Tip: Looking for answers? Try searching our database.

Can I Programmatically assign event and event content?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kan D. - 09 Aug 2006 16:41 GMT
Can an event AND event content be assigned prorammatically to a control?

See below example's ".OnClick" line...

Dim c_imgStatus As Image

With c_imgStatus
.Name = "imgStatus" & i
.Picture = "\\path\path\Status Button.jpg"
.HyperlinkSubAddress = "Form FormName"
       .OnClick = "MyVariable = " my_OtherVariable & Chr(13) & _
        "msgBox MyVariable"
End With

So when I click on the button, I want the click to execute the button's "On
Click" event that I'm trying to programmtically assign...

Thank you for your help,

Kan
Michel Walsh - 10 Aug 2006 00:21 GMT
One possible way is to mimic dot-Net, that is, in the event that fires "your
interest", call all the "procedures"  (with Eval or CallBack) that are
stored into a given collection:

- Create a collection
- Append, in the collection, the (text of the) procedure(s) to be called
(can be done programmatically, can add or remove items (would be procedures)
as it fit your needs, at run time)
- In the event, have fixed code that cycles through each of the elements in
the collection and which Eval it, or CallBack it.

Hoping it may help,
Vanderghast, Access MVP

> Can an event AND event content be assigned prorammatically to a control?
>
[quoted text clipped - 16 lines]
>
> Kan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.