Hi all,
My table, tblBusiness has two fields. [ABN] and [Business Name].
ABN is the primary key.
I've currently got a form to add data to this table, and looking to create my own error message when the user tries to use an existing ABN.
I have two choices.
1. The long way. See if the form's ABN exists in a tblBusiness query recordset
2. The easier way below...
When I attempt to use an existing ABN, the standard "changes not successful because they would create duplicate values in the index" message appears.
I've seen in other languages where error messages have their own number. How do I find the error number of this particular one and use in an IF statement?
i.e.
if error_number = xxx
. msgbox "ABN already exists"
. goto function_end
end if
...continue code...
My table, tblBusiness has two fields. [ABN] and [Business Name].
ABN is the primary key.
I've currently got a form to add data to this table, and looking to create my own error message when the user tries to use an existing ABN.
I have two choices.
1. The long way. See if the form's ABN exists in a tblBusiness query recordset
2. The easier way below...
When I attempt to use an existing ABN, the standard "changes not successful because they would create duplicate values in the index" message appears.
I've seen in other languages where error messages have their own number. How do I find the error number of this particular one and use in an IF statement?
i.e.
if error_number = xxx
. msgbox "ABN already exists"
. goto function_end
end if
...continue code...