default value in dropdown

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.
 
M

Marshall Barton

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.
 
P

ploddinggaltn

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.
 

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