Add Record

A

alex

Experts,

I have a combo box on my form that allows users to obviously select
from a list or type in a value.

If the user types in a value that does not exist, an error occurs
telling the user that said value is not on the list (I set limit to
list = true).

If the user types in a value that does not exist in the table, I want
a message to display that tells the user his/her "value does not
exist; would you like to enter a new record".

I'm assuming this will take a little VBA coding.
Does anyone have an example?
Is the code added to the After Update event?

Thanks for any help ~
alex
 
E

Eric Blitzer

I will do this with macros to make it simple. You could use vb code.
One way would to run a macro in the "Not on list" event of the combobox
this macro would open a form to add the new entry and then refresh the
combobox
In the macro
Action command
runcommand Undo
close current form name
Openform name of form that adds new info

on the new forms close event add another run macro
open form form name

The new name will appear in dropdown list
 
M

Maurice

And in addition to that if you do want to try VBA-code you have to place it
in the NotInList event. Try a search for Not in list in the groups. Various
postings have been posted on this subject. Most likely you'll find about all
the variations you'd like.
 
A

alex

And in addition to that if you do want to try VBA-code you have to place it
in the NotInList event. Try a search for Not in list in the groups. Various
postings have been posted on this subject. Most likely you'll find about all
the variations you'd like.
--
Maurice Ausum








- Show quoted text -

Thanks Maurice and Eric. I did some VBA coding to the On Not in List
event and it works great. I now have to figure out how to turn off
Microsoft's error message--which is may be impossible.

alex
 
Top