PC Review


Reply
Thread Tools Rate Thread

Can I Programmatically assign event and event content?

 
 
Kan D.
Guest
Posts: n/a
 
      9th Aug 2006
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


 
Reply With Quote
 
 
 
 
Michel Walsh
Guest
Posts: n/a
 
      10th Aug 2006


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


"Kan D." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007. Event ID 25, Event ID 2000. Microsoft Office 12. Event ID 2001 David F. Sage Microsoft Outlook Discussion 0 10th Mar 2008 01:24 PM
Can an Event and Event content be assigned programmatically? Kan D. Microsoft Access Form Coding 2 9th Aug 2006 10:12 PM
Can an Event and Event content be assigned programmatically? Kan D. Microsoft Access Forms 1 9th Aug 2006 08:37 PM
Event ID: 1003, Event Type: Error ,Event Source: System Error,Event Category: (102) BoazBoaz Windows XP General 0 21st Jun 2006 05:39 PM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET Framework Forms 14 7th Feb 2005 08:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:36 AM.