Clone Control Events - or how do I parameterise requesting Propert

S

StuartR

I have some forms with 60 objects which I really want to re-design with Tabs.
Everyone knows that if you create a Tab in your form and copy & paste the
controls then you lose the Event links. They are there in the code module.
You just need to re-select them in the pasted control of teh same name (ie
[Event Procedure] in most of the event properties).

I figured out that if you do something like "Debug.Print frm(i).OnDblClick"
- where frm(i) is the current control you are evaluating then you will either
get "" or "[Event Procedure].

This means that I can create a loop, evaluate all the event value, save
field name, event name and form name and write it in a loop to a table.

Then after copy and paste of these fields into the tabs in the form of the
same name I can run a loop to put back the event values. Saves me checking
hundreds of event links and allows me to do this with some other complex
tools.

What I can't figure out is how to parameterise my selection of the event I
want to query and then write back.

So, in the code "Debug.Print frm(i).OnDblClick" is there a way to make
"OnDblClick" a parameter I can load in a loop such that I can write something
like:-

Debug.Print frm(i).(SubstituteParameter). where (SubstituteParameter)
evaluates to one of :-

OnClick
OnDblClick
OnMouseDown
OnMouseMove
OnMouseUp
OnChange
OnEnter
OnExit
OnGotFocus
OnKeyDown
OnKeyPress
OnKeyUp
OnLostFocus
OnNotInList
BeforeUpdate
AfterUpdate

on each loop. This means I can write everything to a table and have that
table drive the reverse process.

Or is there an easier way to do this?

Regards,

Maven
 
S

StuartR

Typical!

I think I found the answer in "Dynamically setting a FORM Control Property
to a new ..."


I need to write it as:-

Debug.Print frm(i).Properties("OnDblClick" )

or a recordset loop version

frm(i).Properties(rs1!NextProperty) = rs1!EventValue

- where "NextProperty" is an index into a table that holds values like
"OnExit", "OnDblClick" etc and "EventValue" holds the event value string I
discovered when I evaluated and wrote the table.

Any Comments would be appreciated.

Regards,

Maven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top