linking text box with after_update procedure using VBA. (3 Viewers)

Kingz

Member
Local time
Today, 19:31
Joined
Mar 19, 2024
Messages
57
Hi,

I've got a form where I dynamically create a text field using
Set ctl= CreateControl(...,acTextbox,...)

Now, in the form, I have written an after update function, which I need to be linked somehow to the created control. How do I do that with VBA.
I know normally, one would go on the text box to the properties and set it manually, but how can I do that with VBA code?

Oh, and if it helps, the text box is set as a date, so if I enter the text box a calendar opens straight away..I would like the event after the date is set.. Isn't that after update of the text box?

By the way, I understand it's not advisable to do such things dynamically, but I need to.
 
Last edited:
Try something like: Me.ControlName.OnAfterUpdate = "[Event Procedure]"
 
Are you building a tool that build forms for yourself because I would not recommend this functionality at all for an app intended for a user.

You don't ever "need" to do this. Business applications do not create new tables/columns/objects on the fly. Tools you build for yourself might. Perhaps you might want to explain the problem you are trying to solve and we can offer a different solution.
 

Users who are viewing this thread

Back
Top Bottom