473,395 Members | 1,624 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,395 software developers and data experts.

Change property in open (active) form from object

Hi All,

I have an issue here, which I would like som help solving.

1. Im opening a form [TheActiveWorkingForm].
2. In Form_load I reference an object
Expand|Select|Wrap|Line Numbers
  1. Dim obj as testobj
  2. set obj= new testobj
3. In the referenced object (testobj) I would like to set the timerInterval=200000 on [TheActiveWorkingForm].
4. Returning from the reference object (testobj) to the form [TheActiveWorkingForm].
5. When the 200 seconds has elapsed, then the timer should trigger its event.

My problem is that It seems that I cant set the timerinterval =200000 from testobj

Thanks in advance
Apr 10 '18 #1
3 1364
twinnyfo
3,653 Expert Mod 2GB
Lars,

Welcome to Bytes!

I am not sure why you are declaring an object and trying to set the Timer Interval that way. You may simply set the form's own timer interval with this language:

Expand|Select|Wrap|Line Numbers
  1. Me.TimerInterval = 200000
Hope this hepps!
Apr 10 '18 #2
This functionality you present is exactly what I wish to avoid.
Your approach only Works in the given form object, not the referenced object (testobj).
I really need to set the timerinterval from the object that is called in the form.
Thanks anyway
Apr 10 '18 #3
NeoPa
32,556 Expert Mod 16PB
LarsBernstorff:
Your approach only Works in the given form object, not the referenced object (testobj).
I really need to set the timerinterval from the object that is called in the form.
Actually, from what you've shared with us, it's quite understandable that we'd assume they are the same. You have shown you have a testobj object created within (and explicitly scoped to) your Form's Load event procedure. From your question it seems clear you intended to use that as some derivative of the Form object and there's nothing to indicate any other Form's involved. So, bearing in mind what they were working with, Twinny's response was perfectly appropriate. As I'll explain later in the post, you'll need to write your questions more clearly if you want the answers to be more helpful. Please understand this is intended as guidance rather than criticism. As I say below, getting such things right first time is very rare.

We're having a little difficulty here understanding what you're trying to achieve and what currently doesn't work. That's quite usual. Most members struggle to explain their situations clearly. I can't begin to explain how important that is for the effectiveness of these forums.

In this case we don't have any explanation of what testobj is and how it's been defined. Nor do we have any indication of what it is that you've tried already that hasn't worked for you. In the absence of these it's quite likely we'll waste all of our time (Time of all of us) making suggestions, that are the obvious ones, that you've already tried. However, for now I'll make some guesses and suggest something.

I guess the testobj is actually some form of object based on a standard Form object. If that's true then I'm not sure how much sense it makes to create a Form (or derivative) instance within the instance itself. We have no idea of your thinking on this one so I'll leave that with you to ponder. I can't imagine a scenario where that makes sense, but maybe there is one. I can't say. It's very hard to prove a negative in such a situation.

The first thing that springs to mind is that while you've created a testobj instance, you've not set it to anything. It's created but essentially empty of any info. From here it looks like you may have intended this instance to be some form of reflection of the current Form, but that's not what the code does.

So, it seems there are two major flaws that you need to deal with before you can make any headway :
  1. Review and fix the scope of the instance of testobj. If you want it to survive beyond the natural life of the Form itself then I would declare it as Public in a Standard Module somewhere.
  2. Set the instance of testobj such that it reflects an actual Form instance. Only when it reflects the desired Form instance will it have any effect when you set both the OnTimer and TimerInterval properties.

If you need further help from us here then you should also consider explaining your question further and show us what it is you're working with.

Best of luck and welcome to Bytes.
Apr 10 '18 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matt | last post by:
Hi group, Here's a problem I've been trying to solve for the past several weeks. I have the standard WebBrowser object added to a form so it can access websites, and I have it load a default...
1
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs...
15
by: mike | last post by:
I'm drawing a blank on this. I have html like: <form name="test1"> <input name="inp1" onclick="alert(this.parent.form);"> <a href="javascript:void(null);"...
0
by: dlieu | last post by:
I've found an odd situation in where the Load event of the active form fires (after the Unload event) when Access is closed. I am able to reproduce this situation in Access 2002 SP3 and Access 2003...
2
by: shal | last post by:
hello I am trying to change text color of the textbox1 from another form named Form2. i am using following code right now but it doesnt change property of textbox1. can you tell me whats wrong...
3
by: BakelNB | last post by:
I am new to the .Net environment, so please bear with me. I am passing a form object (e.g. formA) to an existing form (e.g. formB) by setting a property value defined in formB to hold the formA...
1
by: Mike H | last post by:
I can't seem to figure out the right thing to search on, so I thought I'd just provide an example and see if someone can point me to some tips. What I have is an Automation Server that has a...
1
by: =?Utf-8?B?WmVsamtv?= | last post by:
Hello! I am new in programing and I have this problem: I must on button5_Click move current form. The code of form is: using System; using System.Collections.Generic; using...
10
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've...
1
by: mirandacascade | last post by:
1) Module1 has the following delcaration: Public g_frmZZZ as Form Public g_txtForm2 as Variant 2) app has two forms: form1 and form2 3) a command button on form1 opens form2; it also has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.