Hi all,
I've been working on this problem for 3-4 days now and would really appreciate a definitive answer (i.e. full code in whichever event(s)) to solve the problem.
There is plenty of help out there e.g.: beforeupdate - if me.newrecord then set me.dirty and cancel = true etc etc etc. With each piece of advice, I'm getting yet another error or warning message.
Currently I'm getting: error 2115 - i.e. I'm preventing Access from saving the record!
I'm not one to give up, and I'm still working on this, but have started this thread in hope that I won't be trying to solve this when I reach a ripe old age.
Here's the scenario:
Unbound frmA has a combo (cmbTopic) which is bound.
I want the user to be able to add a new item to this combo via double-clicking it which shows frmTopic_Add. I can't use the combo 'not-in-list' option because the 'Topic' has various other user fields.
When frmTopic_Add is shown, the user has Topic and Description to complete, but on completion of Topic and leaving the field - I have to check that the Topic entry does not already exist in the table.
If it does, I want to:
1) Inform the user that this is a duplicate entry.
2) Set the CALLING FORM cmbTopic to the attempted entry.
3) Close frmTopic_Add WITHOUT saving this 'dirty' record and without having the user to endure useless warning messages from Access.
If I could give you 10 stars for this solution - I would.
Many thanks in advance.
Darrylle
Never argue with an idiot, he'll bring you down to his level - then beat you with experience. darrylles@yahoo.co.uk
I've been working on this problem for 3-4 days now and would really appreciate a definitive answer (i.e. full code in whichever event(s)) to solve the problem.
There is plenty of help out there e.g.: beforeupdate - if me.newrecord then set me.dirty and cancel = true etc etc etc. With each piece of advice, I'm getting yet another error or warning message.
Currently I'm getting: error 2115 - i.e. I'm preventing Access from saving the record!
I'm not one to give up, and I'm still working on this, but have started this thread in hope that I won't be trying to solve this when I reach a ripe old age.
Here's the scenario:
Unbound frmA has a combo (cmbTopic) which is bound.
I want the user to be able to add a new item to this combo via double-clicking it which shows frmTopic_Add. I can't use the combo 'not-in-list' option because the 'Topic' has various other user fields.
When frmTopic_Add is shown, the user has Topic and Description to complete, but on completion of Topic and leaving the field - I have to check that the Topic entry does not already exist in the table.
If it does, I want to:
1) Inform the user that this is a duplicate entry.
2) Set the CALLING FORM cmbTopic to the attempted entry.
3) Close frmTopic_Add WITHOUT saving this 'dirty' record and without having the user to endure useless warning messages from Access.
If I could give you 10 stars for this solution - I would.
Many thanks in advance.
Darrylle
Never argue with an idiot, he'll bring you down to his level - then beat you with experience. darrylles@yahoo.co.uk