Hi Everyone,
After some time away from developing databases, I find myself back into it.
In the current database I am developing, I am trying to handle an error. I'm sure it's because I am rusty, but I need some guidance...
I have a combo box that selects the type of action being recorded, and then creates a control number (combo box selection & record id = ex "CA-0001"). Simple enough. Now when this control number is created, I also create a folder named the same (CA-0001) to store supporting documents for the record.
Later in the process, if the manager decides the combo box selection was the wrong category, he can change it. So when he changes the record, the CA-0001 may become RA-0001. I am also changing the associated folder name to correspond to the new control ID.
All of this is fine, and I can make it work well. However, if there is a file open within the folder I am trying to change, I of course get an error (runtime error 75 to be exact).
Now my question is, would this be better handled in the "before update" event, or just handle the error another way? Ultimately, I want to tell the user the record cannot be changed because someone has a file open or something, then stop the update, which is why I think 'before update'. How would you guys handle this?
For data integrity, I know I probably shouldn't allow the control number to change, but I track it with an audit trail, so I am not too worried about that.
Thanks
After some time away from developing databases, I find myself back into it.
In the current database I am developing, I am trying to handle an error. I'm sure it's because I am rusty, but I need some guidance...
I have a combo box that selects the type of action being recorded, and then creates a control number (combo box selection & record id = ex "CA-0001"). Simple enough. Now when this control number is created, I also create a folder named the same (CA-0001) to store supporting documents for the record.
Later in the process, if the manager decides the combo box selection was the wrong category, he can change it. So when he changes the record, the CA-0001 may become RA-0001. I am also changing the associated folder name to correspond to the new control ID.
All of this is fine, and I can make it work well. However, if there is a file open within the folder I am trying to change, I of course get an error (runtime error 75 to be exact).
Now my question is, would this be better handled in the "before update" event, or just handle the error another way? Ultimately, I want to tell the user the record cannot be changed because someone has a file open or something, then stop the update, which is why I think 'before update'. How would you guys handle this?
For data integrity, I know I probably shouldn't allow the control number to change, but I track it with an audit trail, so I am not too worried about that.
Thanks