Hi all.
I have a wierd problem and I'm not sure if its just me, or if it is an actual problem.
Basically I have a function to insert a record into my SQL DB, and if a primary key violation has happened, then I handle the error by showing a message box, and then allowing the user to re-enter the data. This works fine.
The problem occurs if the user tries to do it again for a second time, an error is generated, but handled by VB rather than my code.
Essentially my code is:
On Error Goto ErrorHandler
StartCreate:
frmDataEntry.show 1 'Show as a modal form
'on return from the form, do this:
CreateRecord "Data","etc","etc" '(CreateRecord is a command in the data environment)
Exit Function
ErrorHandler:
msgbox err.number & err.description
err.clear
goto StartCreate
Any Ideas?
Thanks all.
I have a wierd problem and I'm not sure if its just me, or if it is an actual problem.
Basically I have a function to insert a record into my SQL DB, and if a primary key violation has happened, then I handle the error by showing a message box, and then allowing the user to re-enter the data. This works fine.
The problem occurs if the user tries to do it again for a second time, an error is generated, but handled by VB rather than my code.
Essentially my code is:
On Error Goto ErrorHandler
StartCreate:
frmDataEntry.show 1 'Show as a modal form
'on return from the form, do this:
CreateRecord "Data","etc","etc" '(CreateRecord is a command in the data environment)
Exit Function
ErrorHandler:
msgbox err.number & err.description
err.clear
goto StartCreate
Any Ideas?
Thanks all.