I have two different scripts attached to two different events which seem to be in conflict with each other, but I'm having a difficult time isolating the issue. (See attached file.)
The first script is attached to the form's OnSave event. It checks for certain conditions, and if they are met, enters a new record in another table.
The second script is attached to the CanSaveRecord event in the field rules. It's function is to check for duplicates, and warn the user before allowing the duplicate to be saved. This script is a modification of Peter Wayne's example found at http://www.learn alpha.com/duplicate...ate_detect.htm.
Each of these scripts work fine when the other is not present. However, if they are both being used, I get this error when I try to save the record:
When I first open the form, make a change and save it, no error appears. However, the CanSaveRecord event does not work, because I don't get a warning about duplicates, even when I know there is one. If I make a subsequent change and save it, the error appears.
To make sure the problem wasn't something else in the form, I copied the code from the OnSave event to the default form for the table, and the problem persisted. I even moved the code for the OnSave event to the OnSaveRecord event in the field rules (modified it as necessary), and the problem remained. Does anyone have any ideas?
Nathan
The first script is attached to the form's OnSave event. It checks for certain conditions, and if they are met, enters a new record in another table.
The second script is attached to the CanSaveRecord event in the field rules. It's function is to check for duplicates, and warn the user before allowing the duplicate to be saved. This script is a modification of Peter Wayne's example found at http://www.learn alpha.com/duplicate...ate_detect.htm.
Each of these scripts work fine when the other is not present. However, if they are both being used, I get this error when I try to save the record:
"Script:Table( Youth Bible School )CanSaveRecord line:26
ix=t.query_create()
no such field"
ix=t.query_create()
no such field"
When I first open the form, make a change and save it, no error appears. However, the CanSaveRecord event does not work, because I don't get a warning about duplicates, even when I know there is one. If I make a subsequent change and save it, the error appears.
To make sure the problem wasn't something else in the form, I copied the code from the OnSave event to the default form for the table, and the problem persisted. I even moved the code for the OnSave event to the OnSaveRecord event in the field rules (modified it as necessary), and the problem remained. Does anyone have any ideas?
Nathan
Comment