473,581 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copying controls from a form to a tab control

I have copied approx 20 controls from a form to a tab control for
reasons of space.

i now cannot run code triggered by the events of these controls.

for example, the following will not trigger the message box when
changed:

Private Sub cboA_Change()
MsgBox "combo A changed"
End Sub

the controls are all disabled and are only enabled when the previous
control has a value set.

any ideas?

thanks

Winshent
Nov 13 '05 #1
3 3778
Winshent,

Instead of copying and pasting, try cutting and pasting. If you copy and
then paste, the original controls stay on the form so when you paste the new
controls get new names and not the names you chose which means that even if
you then delete the original controls, the new controls will still have new
names and therefore no events associated with them.

Situation:
cboA gets copies and pasted.
Access changes the name to something like Combo294
You then delete cboA.
Your Module now has cboA_Change() but there is no control named cboA
Combo294 now exists, and looks the same, but has no events associated with.

Make sense?

--
Jeremy Shapiro
Asandia, Corp.
www.asandia.com
1.866.ASANDIA (272.6342)
"winshent" <vi************ *@btinternet.co m> wrote in message
news:c8******** *************** ***@posting.goo gle.com...
I have copied approx 20 controls from a form to a tab control for
reasons of space.

i now cannot run code triggered by the events of these controls.

for example, the following will not trigger the message box when
changed:

Private Sub cboA_Change()
MsgBox "combo A changed"
End Sub

the controls are all disabled and are only enabled when the previous
control has a value set.

any ideas?

thanks

Winshent

Nov 13 '05 #2
On Fri, 11 Jun 2004 15:20:28 -0400, "Jeremy B. Shapiro"
<je************ ***@asandia.com > wrote:
Winshent,

Instead of copying and pasting, try cutting and pasting. If you copy and
then paste, the original controls stay on the form so when you paste the new
controls get new names and not the names you chose which means that even if
you then delete the original controls, the new controls will still have new
names and therefore no events associated with them.

Situation:
cboA gets copies and pasted.
Access changes the name to something like Combo294
You then delete cboA.
Your Module now has cboA_Change() but there is no control named cboA
Combo294 now exists, and looks the same, but has no events associated with.

Make sense?


Also, if you have cut and paste the controls, there's a good chance
that those controls' events will no longer associated with the
controls, even if they are in the form's module. One quick I have
found to deal with this is within the module: ctrl-A (to highlight
everything), ctrl-X to cut, ctrl-V to paste. The cutting and pasting
of all the code will cause all the events to become re-associated with
their controls.

Chuck
Nov 13 '05 #3
Chuck Van Den Corput <NO************ *****@sympatico .ca> wrote in message news:<g0******* *************** **********@4ax. com>...
On Fri, 11 Jun 2004 15:20:28 -0400, "Jeremy B. Shapiro"
<je************ ***@asandia.com > wrote:
Winshent,

Instead of copying and pasting, try cutting and pasting. If you copy and
then paste, the original controls stay on the form so when you paste the new
controls get new names and not the names you chose which means that even if
you then delete the original controls, the new controls will still have new
names and therefore no events associated with them.

Situation:
cboA gets copies and pasted.
Access changes the name to something like Combo294
You then delete cboA.
Your Module now has cboA_Change() but there is no control named cboA
Combo294 now exists, and looks the same, but has no events associated with.

Make sense?


Also, if you have cut and paste the controls, there's a good chance
that those controls' events will no longer associated with the
controls, even if they are in the form's module. One quick I have
found to deal with this is within the module: ctrl-A (to highlight
everything), ctrl-X to cut, ctrl-V to paste. The cutting and pasting
of all the code will cause all the events to become re-associated with
their controls.

Chuck


thanks..

I did actually cut and paste (not copy and paste as described
above-incorrect statement). So i couldn't understand why all the code
was no longer working... even though the control names hadn't changed.

chuck... with regards to selecting all>cutting>pas ting all code in the
module.. I will save the module with empty code and then repaste it..
but if this doesnt work then what should i try? wont be able to work
on this til monday now.

thanks again
Nov 13 '05 #4

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

Similar topics

6
2690
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at http://www.lebans.com/DownloadFiles/A2kTooltip.zip So far the classes work perfectly, except that now I need to extend it to support other controls besides...
3
3790
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76) and they were put onto the form in the numerical sequence. I have given the A's with B & C's on the same line a tag=1; B.tag=2, C,tag=2) I am...
16
7207
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
8
18352
by: Randy | last post by:
Hi, is it possible to show the progress of a big file being copied e.g. in a "progressbar"? I tried to use file.copy - but this seems to make no sense :-( Thanks in advance, Randy
3
2636
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event and this causes control B to be created, when this is done the VIEWSTATE is lost for CONTROL B. In the EVENT that causes CONTROL B to be created...
22
2161
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of...
2
14007
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the MDI child window. How can I make the MDI child window appear in front of any controls that may be on the MDI parent? thanks, John
15
6499
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then...
11
1309
by: Zebra Code | last post by:
hi all i should copy the items of a combo to n other combos. it's not a cycle: With cboColor1 .Items.Add("ffffff") .Items.Add("cecece") ... .SelectedIndex = 0
0
7876
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...
0
8156
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. ...
0
8310
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...
1
7910
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...
0
8180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6563
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...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
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

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.