Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access not running onchange event on some machines

Status
Not open for further replies.

asmith555

Programmer
Oct 7, 2002
97
US
I have created a network centric app in Access 2000 using mainly VBA. I have a combobox that changes the rowsource of another combobox using an onchange trigger. It works fine on some machines but does not fire on others. Does anyone know what might be causing this. All machines run W2K
 
Not sure about your problem, however, usually the AfterUpdate event is used for this. The OnChange event fires every single time you press a key and this is probably not what you need or want. The AfterUpdate event fires once when you are done with the control. I suggest you move your 'change rowsource' code to the AfterUpdate event of your first combo.
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
I don't have an answer either (I'm on NT 4.0 with Access '97) but if your forms aren't bound to anything (using recordsets to update data) then the AfterUpdate might not be your best choice, I a simplistic type when it applies and I would recomend the OnLostFocus, because this is always going to happen. But back to your actual problem. Move the code around and see if it's just the "OnChange" that isn't firing or if it's the code that's not being recognized. Try just putting a messagebox in the OnChange, if it comes up then that's not your problem. Make sure you're not missin any libraries (I know you're not using ADO or DAO or anything, but just take a look). Kyle ::)
 
KyleS,

Presumably his second combo is filtered on the first. If you fire the filter for the second on the OnLostFocus event you'll requery whether you need it or not. If you use the OnUpdate event you'll requery the second only if the first has changed. If the first hasn't changed then presumably the second wouldn't need to change.

Assuming I understand this scenario :) "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
By the way, I like your idea of using a msgbox in the event to see if it's firing. I've done that my self at spots in code more than a few times :)
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
I have put the message box in and it does not fire on the problem machines. There are no missing libraries and I have checked the service packs on all machines. The app is written in mostly strait ADO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top