473,836 Members | 1,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why won't my OnChange event work?

Seth Schrock
2,965 Recognized Expert Specialist
I have a textbox that I'm using as a search field: txtAddress. I have a query that is based on that field using the Like keyword so that I can have wildcards. What I would like to happen is that as I type each character into txtAddress, the subform (that is based on the query) requeries. Here is what I currently have:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtAddress_Change()
  2. If Me.Dirty = True Then Me.Dirty = False
  3. Me.sfrmAddressSearchResults.Requery
  4.  
  5. End Sub
It seems like it is always one change behind. At first I didn't have the 2nd line and nothing happened. That is when I figured out that the value of the field hadn't changed for the query to see it yet, so I had it save and then requery. Now it will change, but if I start to enter 11, and then backspace and then type 80, then it still shows the addresses that starts with 11. If I manually run the query after making the change to txtAddress and then leave the field, the query runs exactly as expected so I know it is in my OnChange event that I'm messing up.
Nov 30 '12
11 22777
Seth Schrock
2,965 Recognized Expert Specialist
Duh... That is so simple even I should have seen that. Oh well.
Dec 3 '12 #11
NeoPa
32,584 Recognized Expert Moderator MVP
I'm sure you would have, given time to allow your concentration to recede from the main issue of getting it to work at all. It's not uncommon to miss details like that while concentrating on just getting it to work.
Dec 3 '12 #12

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

Similar topics

2
18612
by: Matt | last post by:
I have radio buttons on a form, and when the user makes the selection, it will trigger the event and send the form to the web server and print the selected value. In Case 1, I just use submit button, without any event handling, and it works fine. However, in Case 2, which is what I am trying to do, it has the problem that even when the user clicks the button, it won't show the value automatically. But wait until user selects another...
4
2698
by: Barry G. Sumpter | last post by:
Complete newbie here. Just sorted out that myASP.asp will ONLY execute on c:\inetput\wwwroot when I access it thru http://localhost/myASP.asp but if I copy myASP.asp to a sub folder of c:\inetpub\wwwroot like c:\inetpub\wwwroot\myfldr and use http://localhost/myfldr/myASP.asp
2
4265
by: Robbie | last post by:
Hi, I want to programatically fire an event. I have it working in IE, but Netscape won't work. What is the Netscape equivalent to, or a workaround for: document.myForm.myField.onchange(); I've read many posts, but none seem to answer my question. Anyway, my example follows.
2
4239
by: Matt | last post by:
The following code won't work, because onchange event is not trigger when drop down size = 1. But if I make the size="2" or greater, then it will work. Is that true? please advise. thanks!! <script type="text/javascript"> function showRange() { alert("showRange"); } </script> <SELECT NAME="range" SIZE="1" onchange="showRange();">
3
2181
by: dthmtlgod | last post by:
When a user changes the value in a select statement, I would like to update the recordset using a onchange event. Could someone please point me in the right direction? Would like to stay away from forms if possible. <select style="width: 200px; font-size: 10px;" name="selStat" size="1"> <option value="<% = rs("Status") %>"><% =rs("Status") %></option> <option value="CLOSED">CLOSED</option> </select></td>
3
3992
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having a couple of problems, which I'll try to describe. But this e-mail will only reproduce one of them, in a "short" example. What I'm generally doing is having each form entry contained in a div, which as a label, an input with some event handlers,...
3
1345
by: JR | last post by:
I know this is probably dumb but I have a web combo box that will drop down and I can select an item but SelectedIndexChanged doesn't fire. I tried to put the code in the ASP that says on the control: SelectedIndexChanged="vb sub" but that didn't fire either. I must not understand the way the web is interfacing with the code. All the controls are RUNATSERVER so that I can access all the events. Any ideas?
1
6874
by: daokfella | last post by:
I need to raise the onchange event and Firefox is giving me some grief. I hear fireEvent is buggy with some events. Is that true? My code is simply this: targetTextbox.fireEvent("onChange"); Works fine in IE but not in FF. Is there a compatible equivalent in FF?
2
1681
by: Nathan Sokalski | last post by:
I have the following code which allows you to drag a div in IE, and have it then move back to it's natural position when you release the mouse button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><script type="text/javascript">var draggable=0;</script></head> <body> <div id="div1"
13
8766
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which is the behaviour I want make happen in IE. Does anyone know how to accomplish this? Thanks a lot Andy Birchall
0
9818
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
9668
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
10546
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...
0
10254
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...
0
6978
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5648
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4448
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
4015
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3112
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.