pop-up form/message box problem

  • Thread starter hawornk via AccessMonster.com
  • Start date
H

hawornk via AccessMonster.com

I have a main form where records are entered; in one field users select from
a list of citations, if they type something that's not on the list, a message
box pops up asking if they'd like to add the new citation, when they click
"yes" the pop-up form where they enter the citation information opens, no
problem.

HOWEVER, if they close the pop-up form without entering any data the default
Access message " The text you entered isn't an item in the list." appears.
How do I prevent that from happening?
 
B

bhipwell via AccessMonster.com

This may be messy but it is a fix. Instead of having the field detemine if a
field is allowed, use VB code to do it. On the afterupdate event, have VB
run an "If not equal to" code to verify the data. If the data doesn't match,
then generate your message. If they do not want to add a new citation, then
have VB clear the field so unwanted information doesn't get entered. If they
want a new citation, have VB continue to allow new addition.

B
 
H

hawornk via AccessMonster.com

I'm not sure I understand what the data would not be equal to. The users
will be selecting from a list of hundreds of citations. Would I have to set
an "is not equal to" for each citation on the list? If so, how would the
code be updated each time a new citation is added to the list?

I probably should have added that I'm relatively new to all this...
 
B

bhipwell via AccessMonster.com

If you already have code that checks the entry against the available
citations, is it necessary to use the "limit to list" function?
 
H

hawornk via AccessMonster.com

I don't think I have code that does that - I'm using "not on list,"which I
thought requires having "limit to list" set to "yes." Like I said, I'm
pretty new to this.

The only code I have is the code that brings up the yes/no message box to
open the form to add a new citation. That code suppresses the default "not
on list" message, opens the form, but then if someone closes the form without
adding any data, when it closes, the default "not on list" message appears,
as if there had been no code written.

I tried setting warnings to false on the "on close" event of the pop-up form,
but that didn't do anything.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top