473,666 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

BUX
I have to call Forms!myForm.my Control_AfterUp date using
myString = "Forms!myForm.m yControl_AfterU pdate".
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.my Control_AfterUp date"
but it work only if is used without quote in debug window.

Have you any suggestion?
thank you

BUX
Nov 13 '05 #1
2 2023
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_na me"

(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.p rocedure_name", but that
breaks the modern interface paradigm so it was disabled.
(david)

"BUX" <No****@NoSpam. it> wrote in message
news:ib******** *************** *********@4ax.c om...
I have to call Forms!myForm.my Control_AfterUp date using
myString = "Forms!myForm.m yControl_AfterU pdate".
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.my Control_AfterUp date"
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@epsomdot comdotau> 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_na me"

(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.p rocedure_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.my Control_AfterUp date using
myString = "Forms!myForm.m yControl_AfterU pdate".
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.my Control_AfterUp date"
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
1145
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. Eval(form_MyfForm2_AfterUpdate) work only in myDB , but not in library database. I would like to use CallByName() function, but i do not how to set the
3
1705
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
57730
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 ? Thanks Tony
3
2728
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). 'Do something in code frm.ShowDialog (The Form Load Event fires again)
2
2054
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 box. If the result is ok, I show a form with related information about the file. However, there are only specific files allowed. In the MDI child form load event, I check the validity of the file (right version, not open in another app, etc.)....
4
3509
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 seperate file-handling class. The problem is that I cannot get access to the Form. The delegate passes in an 'object' that I can cast to System.Windows.Form.ToolStripMenuItem. I can call GetParent() on that to get the ToolStrip. I can query...
7
2175
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 some-what. I am able to call form remotely and return data to client but somewhere after closing remote form and returning data - I get a Windows exception -
1
1382
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 moment . i am using the following code which is written in form f2
1
4017
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) that loops through controls, changing the BackColor to white except for the control with the focus, which has a BackColor of yellow. This all works fine. Problem is the end users often move around the Form using the mouse and clicking into...
0
8445
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7386
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.