473,769 Members | 6,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why doesn't Onclick event doesn't fire for subform after changing its sourceobject?

5 New Member
I have a generic subform control (subMain) whose sourceobject changes based on a combobox selection. Each sourceobject is a separate subform. These subforms (subsub1, subsub2 etc) have a field whose onclick event is
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "frmVendor"
. When subMain is loaded its default sourceobject is subsub1 and the onclick event works fine. However, when I make a new selection in the combobox and change subMain's sourceobject to subsub2, subsub2's onclick event doesn't work - I click and nothing happens. If I revert the sourceobject to subsub1, subsub1's onclick event continues to function properly.
The only difference between subsub1 and subsub2 is that the field with the onclick for subsub2 is a combobox. Could that be what is causing nothing to happen for subsub2's onclick?
Nov 2 '10 #1
4 3280
Mariostg
332 Contributor
bbobely,
You could check if the cause of the problem is really what you are wondering by changing the event property of the combo box to say After Update instead of OnClick.

Also, you could insert a breakpoint in your code and execute step by step from the breakpoint to see what is going on.
Nov 3 '10 #2
The combobox on subsub2 doesn't allow the user to make choices. It's a combobox merely because the query source for subsub2 returns a number for this field which I don't want displayed. So, instead I use the number as the bound column of the combobox so that the field displays a word from a table and not the number (confusing I know and probably not the best solution). Anyway, I worked around the problem by using the onMouseDown event instead of OnClick. Thanks!
Nov 3 '10 #3
Sometimes you have code for an onclick event, but the onClick event isn't enabled. You have to make sure in the properties for whatever control you're using has [Event Procedure] in the OnClick event.
Nov 3 '10 #4
The OnClick event was enabled with [Event Procedure] in the OnClick field of the properties list. All other macros for the database are working properly as well. If I figure out why this wasn't working I'll post the solution. Thanks again!
Nov 3 '10 #5

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

Similar topics

0
342
by: Alex Stevens | last post by:
Hi, I have a page in which I've added code to the Page_Load event. I send the url to a user in an email, and they click on it to activate an account. I put a breakpoint on the first execuable line of code in the page load event. The breakpoint works fine when linked to from another page on the site, and
3
12332
by: KathyB | last post by:
Hi, clearly I'm just not getting something here. I have an aspx form with ONE textbox and several label controls on it. I have the textbox set to AutoPostBack = True, but when I enter my text and hit ENTER, nothing fires. Oddly enough, this is similar to the button problem I've just posted as well. I use similar code for the textbox textchanged event, but it doesn't fire on that page either IF I remove the button (even though I don't...
2
3861
by: hn | last post by:
Hi, I have linkbuttons created dynamically and they display fine on the web page. However, when I click on the those link buttons, the event doesn't fire. Please tell me what's wrong with the following code. Thanks. Dim lbtnQuestion As LinkButton = New LinkButton lbtnQuestion.Text = "Question " & (j + 1).ToString()
1
5740
by: Jack | last post by:
Hello, I have a dropdown list on a user control and the AutoPostBack property is set to True. I want to use the SelectedIndexChanged event to populate some text boxes based on what the user chose in the dropdown list. However, the SelectedIndexChanged event doesn't fire. In the immediate window it appears that the index is not changing when I select a different option in the list.
4
6535
by: Ryan | last post by:
Hello, I have a standard HTML button on an aspx web form that I have set to runat server. The button is named reset1 and its tag is as follows: <INPUT id="btnReset1" style="WIDTH: 60px; HEIGHT: 24px" type="reset" value="Reset" name="btnReset1" runat="server"> Using Interdev I then double click the button in design view and in the code behind page (aspx.vb) have the following:
2
1615
by: kgadia | last post by:
Hi, I have implemented global exception handler using http module by intercepting the Error event. The code works fine on my machine but the error event fails to fire when deployed on the test servers. The assembly containing the http module code has full control permissions to everyone.
3
4756
by: rfinch | last post by:
I'm trying to pass two values from client script (Javascript) to the code-behind for a page using three hidden fields - two to hold the values and a third to fire the ValueChanged event. I have tried every method I can think of to get the event to fire, but it will not, so either I am missing some code or am misunderstanding the nature of the event. If anyone can review the test code posted below (which I created to try to debug the...
4
8957
by: Mark Olbert | last post by:
I'm trying to understand how to respond to mode changing events in a FormView control. I'm not using datasource controls, so I have to do more of the plumbing myself. Do I have to call the ChangeMode() method in the ModeChanging event handler? Why doesn't the ModeChanged event fire? I can see the mode in the process of changing, because my ModeChanging handler gets called, but then the ModeChanged handler never gets called. - Mark
4
2093
by: suzanne.boyle | last post by:
Hi, I'm adding an ImageButton as a child to a custom web control and attaching an event handler to it. When the page posts back the event is not being fired however. I initially assumed I had missed some code or something however after playing about I've found that if I change the control to a Button (or a LinkButton) the event fires. Here is the code called in the overridden CreateChildControls method. ImageButton btn = new...
8
2497
by: -Karl | last post by:
Snippet: http://www.nomorepasting.com/getpaste.php?pasteid=1020&seen=true&numbered=on&langoverride=asp Line 37 is where I am having the problem. I can't get the onclick event to fire off. Yet line 16 works like it's supposed to. How do I get my onclick event to work? I tried changing it from onclick to onserverclick but that had no effect. Thanks!
0
9590
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
9424
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
10223
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
10051
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
10000
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
9866
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
3968
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
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.