mloucel
Member
- Local time
- Today, 05:55
- Joined
- Aug 5, 2020
- Messages
- 313
Hello All:
I've been trying to fix a very small routine I had IN A FORM CALLED [ PatientEditF ].
I was instructed to correct my code to do it under the " Form_BeforeUpdate " for my routine checking my data.
I did, and I rebuilt the whole form, ground up.
Now I am receiving the Runtime error 2115.
I have searched here [AWF] and some other [stackoverflow], etc, where they discuss SIMILAR issues to mine but no matter what I try, I cannot figure out how to fix the issue.
I have the form and the code attached.
in the original form I have 3 buttons, at the end, Search [for a new record to edit], Save, and quit.
IN MY TEST DB, to avoid a large DB I got rid of the search button and code, since that worked fine and was not needed to replicate the problem; ALSO the FORM has ENABLED the NAVIGATION BUTTONS, so that you can move from record to record to test, ALL RECORDS ARE FAKE.
At this point I cannot save any data, when I use the BeforeUpdate I have tried to check for all possible errors [Blank fields, Changed Fields] which the end user can actually do, when I hit the save button the BeforeUpdate checks and if everything is correct, should ask the user if he/she wants to save the data and return to the form withe the saved data, but I get the 2115 , then I changed the line in me.dirty=false in the beforeupdate to REM, letting the button do the save, and I got into a LOOP, and finally the "You can't save this record" error and of course the record is not saved.
Now I tested the QUIT button, make any change to the data, BeforeUpdate checks, display the message, and answer NO to save the data, and the button works, no data saved, now I test YES, back again to 2115, I cannot change this time the line "Me.Dirty = False" because in my view defies the purpose.
I'm sorry if you laugh of such D...b error but I don't really know what to do.
Any help will be appreciated.
Maurice.
I've been trying to fix a very small routine I had IN A FORM CALLED [ PatientEditF ].
I was instructed to correct my code to do it under the " Form_BeforeUpdate " for my routine checking my data.
I did, and I rebuilt the whole form, ground up.
Now I am receiving the Runtime error 2115.
I have searched here [AWF] and some other [stackoverflow], etc, where they discuss SIMILAR issues to mine but no matter what I try, I cannot figure out how to fix the issue.
I have the form and the code attached.
in the original form I have 3 buttons, at the end, Search [for a new record to edit], Save, and quit.
IN MY TEST DB, to avoid a large DB I got rid of the search button and code, since that worked fine and was not needed to replicate the problem; ALSO the FORM has ENABLED the NAVIGATION BUTTONS, so that you can move from record to record to test, ALL RECORDS ARE FAKE.
At this point I cannot save any data, when I use the BeforeUpdate I have tried to check for all possible errors [Blank fields, Changed Fields] which the end user can actually do, when I hit the save button the BeforeUpdate checks and if everything is correct, should ask the user if he/she wants to save the data and return to the form withe the saved data, but I get the 2115 , then I changed the line in me.dirty=false in the beforeupdate to REM, letting the button do the save, and I got into a LOOP, and finally the "You can't save this record" error and of course the record is not saved.
Now I tested the QUIT button, make any change to the data, BeforeUpdate checks, display the message, and answer NO to save the data, and the button works, no data saved, now I test YES, back again to 2115, I cannot change this time the line "Me.Dirty = False" because in my view defies the purpose.
I'm sorry if you laugh of such D...b error but I don't really know what to do.
Any help will be appreciated.
Maurice.