Lookup field on form - requires two updates

B

bestbapu

I have a lookup field on a form (first navigation) for the Day of the week.
When a new record is created, the field has "Sunday" in it. If I change it
then tab to the next field, the Day field reverts back to Sunday. If I then
change the Day field again the value stays however once I commit the record
the Day is Sunday again. Now if I update the record, the value changes.

How can I correct this behavior?

TIA.
 
J

Jeff Boyce

Do you have a "DefaultValue" set for the control? If so, what?

Do you have code that runs 'behind the form'? If so, what?

Where are you confirming that the Day is committed to the record as
"Sunday"? Is that just in the form, or are you checking the underlying
table?

I don't understand what you mean by "Now if I update the record, the value
changes." Does that mean on a record you've already committed, any change
causes Day to become Sunday?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

bestbapu

Jeff,

No default value set for that control.
No code that runs behind the form.
I confirm that the Day stays to Sunday after the row is commited.
What I meant by "Now if I update the record, the..." is that once a record
is committed, I can view it again and change the value and it stays changed.
 
L

Linq Adams via AccessMonster.com

No default value set for that control.
No code that runs behind the form.

Sorry, but these two sentences together make no sense, given your original
statement

"When a new record is created, the field has "Sunday" in it."

"Sunday" has to be set as the default value somewhere, it just doesn't fall
out of the sky!

If by "lookup field" you're referring to a combobox with the days of the week
in it, my guess would be that

1) You've set this combobox to default to Sunday

2) The combobox is not bound to a field in the underlying table

If you want the value you pick for RecordA to still be there, after going to
another record and then returning to RecordA, it has to be saved as part of
RecordA. In other words, it has to be bound to the record in the table.
 
Top