Ok, here's the scenario for your lovely selfs:
I have a form to add records. On this form is an "Add Record" button, that of course adds the record when the data is entered.
2 of the fields on this form (CompanyName and PostCode) are related to 2 fields in the main table that are indexed, so that the combination of the 2 has to be unique. Ie. The user cannot add a record if the Company Name AND Postcode are duplicated.
6 of the fields on the form are required (including the CompanyName and PostCode fields). Therefore, the user cannot add the record any of the fields are blank.
I have managed to set it so that if either problem exists (duplicate record or missing required field), an error message pops up and the record cannot be added until the problem is rectified.
Using Err.Number, i have found that the error number is 2105 - "Cannot go to specified record", regardless of which problem is occuring.
I want to be able to tell the user exatly what the problem is, without having to say "It could be this or it could be that".
I believe this can be done with Select Case, but that works the different error numbers.
My question is, why am i only getting the one error number regardless of what the problem is?
And then, how can i differentiate between them?
I am pretty new to Access, so please forgive me if this is a daft question.
Cheers,
Dave
I have a form to add records. On this form is an "Add Record" button, that of course adds the record when the data is entered.
2 of the fields on this form (CompanyName and PostCode) are related to 2 fields in the main table that are indexed, so that the combination of the 2 has to be unique. Ie. The user cannot add a record if the Company Name AND Postcode are duplicated.
6 of the fields on the form are required (including the CompanyName and PostCode fields). Therefore, the user cannot add the record any of the fields are blank.
I have managed to set it so that if either problem exists (duplicate record or missing required field), an error message pops up and the record cannot be added until the problem is rectified.
Using Err.Number, i have found that the error number is 2105 - "Cannot go to specified record", regardless of which problem is occuring.
I want to be able to tell the user exatly what the problem is, without having to say "It could be this or it could be that".
I believe this can be done with Select Case, but that works the different error numbers.
My question is, why am i only getting the one error number regardless of what the problem is?
And then, how can i differentiate between them?
I am pretty new to Access, so please forgive me if this is a daft question.
Cheers,
Dave