View Single Post
  #4  
Old March 29th, 2010, 05:53 PM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Generating a new Record

That depends upon the constant you use:

acDataErrDisplay - (Default) Displays the default message to the user.
You can use this when you don't want to allow the user to add a new value to
the combo box list.

acDataErrContinue - Doesn't display the default message to the user.
You can use this when you want to display a custom message to the user. For
example, the event procedure could display a custom dialog box asking if the
user wanted to save the new entry. If the response is Yes, the event
procedure would add the new entry to the list and set the Response argument
to acDataErrAdded. If the response is No, the event procedure would set the
Response argument to acDataErrContinue.

acDataErrAdded - Doesn't display a message to the user but enables
you to add the entry to the combo box list in the NotInList event procedure.
After the entry is added, Microsoft Access updates the list by requerying
the combo box. Microsoft Access then rechecks the string against the combo
box list, and saves the value in the NewData argument in the field the combo
box is bound to. If the string is not in the list, then Microsoft Access
displays an error message.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"Ray C" wrote in message
...
Hi Arvin, thanks for coming back to me, it is much appreciated.

I don't think that I need the generic NotinList code, I have that. I think
I
need to understand if the NotinList code will add a new record to the
Table
or of it will modify the Drop Down List only. Forgive me pleas, I get
confused when dealing with Tables and Forms.
Thanks RayC


"Arvin Meyer [MVP]" wrote:

If you're looking for generic NotInList code:

http://www.datastrat.com/Code/NotInListCode.txt

or a demo of that code is at:

http://accessmvp.com/Arvin/NotInListDemo.zip
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"Ray C" wrote in message
...
Can anyone help point out what i am doing wrong Please?
I want to generata a new record and I get to that point by having the
user
enter a search for a record in a Table via a combo. When the record is
Found
in the Table, no problem The user can view the Record, Edit it, etc.
When
the record is not Found in the Table, the "not in List" event triggers
the
question "Not Found, Do You Want To Generate"? The answer "Yes"
triggers
the
Code
DoCmd.accNewRecord acForm,Me.Name,acNewRec
My Form then displays a blank series of Fields (Name Address, etc) and
my
thought proccess is to just tell the program to go into my normal
"Record
Edit Routine" to enter the information into the Blank Fields of what I
think
is the new Record.
HOWEVER, when I look at the Table the new record is there but the
informatiion I enter via my Edit Routine is saved in the previous
Records@
Fields.

Its as though the new record is generated after I have edited the
Previouse
Record's Fields (though the previous record's information is not
displayed
when I am editing what i think is the new record). Am I missing
something
like "Requery" or Append or something similar to fix the New Record as
the
New Last Record?

Everything worls fine EXCEPT when I look at the table, there is a new
Record
under the name that i originally entered but any subsequent information
i
entered into the blank Records are there BUT they are held in the
previous
records fields.
Any Help appreciated.

Regards Ray C



.