473,396 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I call a form's event using a string

BUX
I have to call Forms!myForm.myControl_AfterUpdate using
myString = "Forms!myForm.myControl_AfterUpdate".
I have tried with

Application.Run myString

Call myString

eval myString

but no one work.

I tried also using the class module name:
myString= "Form_myForm.myControl_AfterUpdate"
but it work only if is used without quote in debug window.

Have you any suggestion?
thank you

BUX
Nov 13 '05 #1
2 2011
You need to change the event handler from Private
to Public. Then:
Set frm = forms("frmName")
CallByName frm "procedure_name"

or

Run "forms('frmName').procedure_name"

(but for form procedures the 'run' method will
run the procedure twice every time you call it.)

In A97, there was a way to call form procedures
directly: Run "form_frmName.procedure_name", but that
breaks the modern interface paradigm so it was disabled.
(david)

"BUX" <No****@NoSpam.it> wrote in message
news:ib********************************@4ax.com...
I have to call Forms!myForm.myControl_AfterUpdate using
myString = "Forms!myForm.myControl_AfterUpdate".
I have tried with

Application.Run myString

Call myString

eval myString

but no one work.

I tried also using the class module name:
myString= "Form_myForm.myControl_AfterUpdate"
but it work only if is used without quote in debug window.

Have you any suggestion?
thank you

BUX

Nov 13 '05 #2
BUX
It work!
Thank you veru much.
On Mon, 3 Oct 2005 09:01:04 +1000, "david epsom dot com dot au"
<david@epsomdotcomdotau> wrote:
You need to change the event handler from Private
to Public. Then:
Set frm = forms("frmName")
CallByName frm "procedure_name"

or

Run "forms('frmName').procedure_name"

(but for form procedures the 'run' method will
run the procedure twice every time you call it.)

In A97, there was a way to call form procedures
directly: Run "form_frmName.procedure_name", but that
breaks the modern interface paradigm so it was disabled.
(david)

"BUX" <No****@NoSpam.it> wrote in message
news:ib********************************@4ax.com.. .
I have to call Forms!myForm.myControl_AfterUpdate using
myString = "Forms!myForm.myControl_AfterUpdate".
I have tried with

Application.Run myString

Call myString

eval myString

but no one work.

I tried also using the class module name:
myString= "Form_myForm.myControl_AfterUpdate"
but it work only if is used without quote in debug window.

Have you any suggestion?
thank you

BUX


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: BUX | last post by:
I have myDB with myForm1 and myForm2. MyForm1' s code call myFunction() in a library database. MyFunction have to call myfForm2_AfterUpdate MyfForm2_AfterUpdate is declared as public. ...
3
by: Sanjay Minni | last post by:
Hi I have several different types of form e.g. - custmaster - prodmaster - invoice all inherited from different form types
20
by: anthonymelillo | last post by:
Is there a way to call a button click event from somewhere else ? I have a text box where I would like to call a button click event when a user presses enter in the text box. Can I do this ?...
3
by: Dennis | last post by:
I have the following code for showing a form: dim frm as new myForm frm.ShowDialog (The Form Load Event is fired then I hide the form using Me.Hide when the X in the UR corner is clicked). ...
2
by: lgbjr | last post by:
Hi All, I see that this topic was discussed back on august 23rd, but I didn't see a real answer. I have a VB.NET MDI app. A particular menu action on the MDI parent is to call an OpenFileDialog...
4
by: Martijn Mulder | last post by:
I have a menu option 'Open...' that opens an OpenFileDialog to select an image file to open. Than I need to call Form.Invalidate() to clear the Form and display the image. This happens in a...
7
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I am trying to see if I can call a Library remotely. The library contains a Form that I want to display then pass back some data to user that called this form remotely. I have it working...
1
by: gracepaul | last post by:
hi all, I want to call the Mouse_Click event from the previous form f1 in the next form f2. how can do that? when i close the form f2 and then raise the mouse_click event in form f1 at that...
1
by: bigukfan | last post by:
I have a single Form with a Tab Control with multiple pages, and over 200 controls, mostly Textbox and ComboBox. I have some code that is fired by the KeyPress event of the Form (KeyPreview = True)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.