Control retains previous value

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

Guest

How do I make a combo box retain the previous value such that in continous
entry if a value does not change the data enterer can just tab the the next
control?
 
In the AfterUpdate procedure of your combo:

Me.YourCombo.DefaultValue = Me.YourCombo

Is that what you're after?

Brian
 
When I insert that code I get #Name? in the combo box when I try to enter a
new record instead of the last value. I had a similar problem when I set up
the same code for an option group. There I had to put this code in the on
current event as well. When I do this for the combo box I get an error which
says:
Run-time error '2447': There is an invalid use of the . (dot) or ! operator
or and invalid parentheses.
This is the code that the debugger points to:
Me.Combo103.DefaultValue = Me.Combo103
Bob
 
Funny, works for me everytime. Perhaps try:

Me!Combo103.DefaultValue = Me!Combo103

Brian
 
I tried your suggestion. It didn't make any difference. Something is
missing as signified by the invalid use of the . (dot) or ! .
Is it because I am getting the values to put in the box from a table that is
different than the table they are going into. This seems right, but maybe
this makes a difference.
Bob
 
I changed to a list box and at least it retains the value. Another problem
appeared which is the subject of a new post.
Bob
 
Back
Top