Still get "not in list" error after setting Response=acDataErrAdde

G

Guest

Hi,

Using other posts as guides, I've created my NotInList routine. I prompt my
user with a form and on detecting that they've added the record I set
Response=acDataErrAdded.

However, I'm still getting the "the text you entered isn't an item in the
list" error.

When I clear the error, I scroll through the list and see my addition. I
thought the problem might possibly be related the fact that the user's entry
(in my case, a [User] field with a value of 'SmithJ' ) isn't the key to the
underlying record or the [User] table; rather, the key is a number. So I
tried to set NewData to my newly created key, but to no avail.

Any ideas?
 
G

Guest

Oh, I think I figured it out. My dropdown's definition of the [User] rows is:

[UserID] (hidden)
[UserLast] + ', ' + [UserFirst] + ' (' + [UserCode] + ')' (displayed)

I was just entering the value for the [UserCode] I wanted to create, so in
my example, 'SmithJ' truly isn't found; I guess I'd have to create the full
matching display value of 'Smith, John [SmithJ]' to match correctly. Perhaps
I need to set this into NewData.
 
G

Guest

Well my suspicion was currect; when I defined the column to just [UserCode]
my typed user code value completion-matched without error. My theory that I
could supplant NewData with the formatted value of my combined fields isn't
flying. I could swear it worked once; I'm not sure what I'm doing wrong.

If I can't make this happen, I'll just have to undo the row and do a
..requery. Unless someone can see through my mistakes.

KitCaz said:
Oh, I think I figured it out. My dropdown's definition of the [User] rows is:

[UserID] (hidden)
[UserLast] + ', ' + [UserFirst] + ' (' + [UserCode] + ')' (displayed)

I was just entering the value for the [UserCode] I wanted to create, so in
my example, 'SmithJ' truly isn't found; I guess I'd have to create the full
matching display value of 'Smith, John [SmithJ]' to match correctly. Perhaps
I need to set this into NewData.


KitCaz said:
Hi,

Using other posts as guides, I've created my NotInList routine. I prompt my
user with a form and on detecting that they've added the record I set
Response=acDataErrAdded.

However, I'm still getting the "the text you entered isn't an item in the
list" error.

When I clear the error, I scroll through the list and see my addition. I
thought the problem might possibly be related the fact that the user's entry
(in my case, a [User] field with a value of 'SmithJ' ) isn't the key to the
underlying record or the [User] table; rather, the key is a number. So I
tried to set NewData to my newly created key, but to no avail.

Any ideas?
 
M

Marshall Barton

KitCaz said:
Well my suspicion was currect; when I defined the column to just [UserCode]
my typed user code value completion-matched without error. My theory that I
could supplant NewData with the formatted value of my combined fields isn't
flying. I could swear it worked once; I'm not sure what I'm doing wrong.

If I can't make this happen, I'll just have to undo the row and do a
.requery. Unless someone can see through my mistakes.

KitCaz said:
Oh, I think I figured it out. My dropdown's definition of the [User] rows is:

[UserID] (hidden)
[UserLast] + ', ' + [UserFirst] + ' (' + [UserCode] + ')' (displayed)

I was just entering the value for the [UserCode] I wanted to create, so in
my example, 'SmithJ' truly isn't found; I guess I'd have to create the full
matching display value of 'Smith, John [SmithJ]' to match correctly. Perhaps
I need to set this into NewData.


I don't think messing with NewData will accomplish anything
useful. The critical point to what you are doing is to add
the new record with **exactly** the same date that you typed
into the combo box AND it must match the displayed value.

I believe that means you can not concatenate several fields
into one display field without playing several other games.
A better way to display the other values is to use a text
box next to the combo box and pull the individual fields
from the combo box columns in an expression like:
=combo.Column(1) & ", " & combo.Column(2)
 
G

Guest

OK, thanks Marsh!

Marshall Barton said:
KitCaz said:
Well my suspicion was currect; when I defined the column to just [UserCode]
my typed user code value completion-matched without error. My theory that I
could supplant NewData with the formatted value of my combined fields isn't
flying. I could swear it worked once; I'm not sure what I'm doing wrong.

If I can't make this happen, I'll just have to undo the row and do a
.requery. Unless someone can see through my mistakes.

KitCaz said:
Oh, I think I figured it out. My dropdown's definition of the [User] rows is:

[UserID] (hidden)
[UserLast] + ', ' + [UserFirst] + ' (' + [UserCode] + ')' (displayed)

I was just entering the value for the [UserCode] I wanted to create, so in
my example, 'SmithJ' truly isn't found; I guess I'd have to create the full
matching display value of 'Smith, John [SmithJ]' to match correctly. Perhaps
I need to set this into NewData.


I don't think messing with NewData will accomplish anything
useful. The critical point to what you are doing is to add
the new record with **exactly** the same date that you typed
into the combo box AND it must match the displayed value.

I believe that means you can not concatenate several fields
into one display field without playing several other games.
A better way to display the other values is to use a text
box next to the combo box and pull the individual fields
from the combo box columns in an expression like:
=combo.Column(1) & ", " & combo.Column(2)
 

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