Automate Population in Fields

G

Guest

I have a form/subform, that has a combo box. When I select from the combo
box (Employee ID) ,it automatically populates the Employee Lastname, and
Employee FirstName field.
But for some strange reason, when I open the form, the EmployeeLastname, and
Firstname fields are automatically populated, but the combo box is blank. I
basically have to reselect from the combo box to get everything back in sync.
I have modified the properties of the combo box to select from the
appropriate record, but this throws everthing off, so I just left the
settings as they were.
What I basically want to do is to have all the fields populated with first
record by default, when the form is open (including the combo box.) or just
have all the fields blank, until I make my selection from the combo box.
Hope this makes sense.
 
S

Svetlana

On Open event of your form try the code and see how it works
Me.[Employee ID].SetFocus
Me.[Employee ID].ListIndex = 0
 
G

Guest

I tried that , didn't work.
Getting the following error message: Invalid use of property
 
A

AccessVandal via AccessMonster.com

Don't use that on the on open event.

Use the current event, use requery like,

Me.[Employee ID].Requery - this will requery the combo box
On Open event of your form try the code and see how it works
Me.[Employee ID].SetFocus
Me.[Employee ID].ListIndex = 0
 

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