default value in dropdown

  • Thread starter Thread starter ploddinggaltn
  • Start date Start date
P

ploddinggaltn

I have a form that the user enters information on, the form name is
frmStudents. I have a dropdown box for school name on the form. When the
user enters students data into the table with the form, they tend to enter
numerous students for each school at one time. I'd like the default for the
dropdown to be the previous school selection from the dropdown so the person
keying the data can just tab by that field until it is time to change the
school name. Is there some code that I can put in the default to stipulate
the last selection display as the default value or some VB code? As always I
appreciate your help.
 
ploddinggaltn said:
I have a form that the user enters information on, the form name is
frmStudents. I have a dropdown box for school name on the form. When the
user enters students data into the table with the form, they tend to enter
numerous students for each school at one time. I'd like the default for the
dropdown to be the previous school selection from the dropdown so the person
keying the data can just tab by that field until it is time to change the
school name. Is there some code that I can put in the default to stipulate
the last selection display as the default value or some VB code? As always I
appreciate your help.


Use the combo box's AfterUpdate event:

Me.thecombobox.DefaultValue = """" & Me.thecombobox & """"

drop the quotes and ampersands if the combo box's is bound
to a Number type field.
 
Worked like a charm, thank you Marshall!

Marshall Barton said:
Use the combo box's AfterUpdate event:

Me.thecombobox.DefaultValue = """" & Me.thecombobox & """"

drop the quotes and ampersands if the combo box's is bound
to a Number type field.
 
Back
Top