Entry of repeated value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A list box is set to retain its value. If it is just Tabbed over a null is
entered into the table instead of the value. If a letter is struck, then the
first value from the source table is displayed and entered. If the same
letter is struck as the value displayed, then the value is displayed. What
code placed where will allow you to just tab past the item to the next item?
There are two items to be entered. I want to just input tab, tab data when
the first item remains the same as the last entry.

Bob
 
Bob Paup said:
A list box is set to retain its value. If it is just Tabbed over a
null is entered into the table instead of the value. If a letter is
struck, then the first value from the source table is displayed and
entered. If the same letter is struck as the value displayed, then
the value is displayed. What code placed where will allow you to
just tab past the item to the next item? There are two items to be
entered. I want to just input tab, tab data when the first item
remains the same as the last entry.

Is this list box bound to a field, or is it unbound? If it's unbound,
is there code in one of its events that updates the field?

If it's a bound list box, you probably want to put code in its
AfterUpdate event to set its DefaultValue property to its current Value.
But I think from your description that maybe it's unbound. If so,
please post the code behind the list box.
 
It is bound. The code in the after update is:
Me.List105.DefaultValue = Me.List105

This makes the value appear,but it is not enterd. In the form a diamond
points to the field, but unless you click on it, it does not turn into a
pencil. If you click on it, it works ok. Tabbing past it moves to the next
field. The pencil appears after you start to enter something, but the value
in the field tabbed over does not get entered. The value in the field is
null.
 
Bob Paup said:
It is bound. The code in the after update is:
Me.List105.DefaultValue = Me.List105

This makes the value appear,but it is not enterd. In the form a
diamond points to the field, but unless you click on it, it does not
turn into a pencil. If you click on it, it works ok. Tabbing past
it moves to the next field. The pencil appears after you start to
enter something, but the value in the field tabbed over does not get
entered. The value in the field is null.

Hmm. What type of field is this list box bound to? Does it make any
difference if you rewrite that line of code as

Me.List105.DefaultValue = Chr(34) & Me.List105 & Chr(34)

?
 
It is bound. The code in the after update is:
Me.List105.DefaultValue = Me.List105

This makes the value appear,but it is not enterd. In the form a diamond
points to the field, but unless you click on it, it does not turn into a
pencil. If you click on it, it works ok. Tabbing past it moves to the next
field. The pencil appears after you start to enter something, but the value
in the field tabbed over does not get entered. The value in the field is
null.

You do need to enter data into SOME bound control before the
DefaultValue takes effect: is this the only field you're adding (other
than an autonumber or another defaulted field)?

John W. Vinson[MVP]
 
The list box was bound to a text field.

Both Goldgar's and Vinson's replies were important. It appears I needed to
put it in quotes and enter another value which I was doing but I was relying
on the previous value when I first opened the form and this did not work.
Once I started my data entry on a fresh table the problem was resolved using
the quotes.

Thank you for your wonderful help.

Bob
 
Back
Top