Form Controls Firing Different Code -Access 2003

hangbill

Registered User.
Local time
Today, 09:46
Joined
Oct 30, 2009
Messages
14
Hi Folks Sorry for the title but dont know how to better describe it. Have the weirdest thing happening. Db has some 7300 records, most of the fields are in one table. All of the records were entered via a form. Form had code, enabling and disabling controls and adding and deleting values depending on data entry. It worked ok, but not completely ok. Then changed the whole format. Copied the form, gave it a new name, deleted all the code, and changed to an OnChange event process. This works because the controls that fire are all drop downs and I have disabled the keyboard for these drop downs. So as a new value is clicked the OnChange event fires and most everything works OK. Except that it does not fire properly if I edit any of the records that were created before I changed the code. They seem to do their own thing; records change but not what I expect. How is it possible for one control to fire two separate codes, one for new records and new records that I edit, and another code for records that were created under the original code. It must be linked to the previous code which I have deleted. Cannot figure it out. Sorry if it`s too vague but if anyone has seen someting like this and can give a pointer, would very much appreciate it. Many thanks
 
First of all, you shouldn't be using the On Change event. You should be using the BEFORE UPDATE or AFTER UPDATE event depending on what code you are trying to run and what it is you are trying to accomplish.

So, what code are you trying to run?
 
Thanks Bob, I know I shouldnt be using OnChange in general and I wont in future but it`s too far gone now. And it does work because I have disabled the keyboard so choosing a drop down value is a change, ie in this scenario the OnChange does work. Have multiple OnChange events happening. There are 12 combo boxes, all interacting. If I enter new records everything works fine. Some controls become enabled, others disabled. Other controls get values, other have values removed. All depends on what is clicked. The problem is with values that were entered before I made the code changes; they dont follow the code rules and I cant figure out why
 
I'm not sure but I think I might be able to figure it out if I could get a copy of your database (with bogus data of course). I'm more "visual" and "hands-on" for my troubleshooting so I can do that much easier than trying to think of reasons why.
 
Thanks for the offer Bob, really appreciate that. Unfortunately I cant send the db, realize I have not given enough for you to help. I will speak to our IT folk tomorrow see if they can see what I`m doing wrong. Again, thanks
 

Users who are viewing this thread

Back
Top Bottom