Refresh Combo Entries

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

Guest

Professionals:

I have a issue log form based on an issues table.

It contains a combo box for employee name based on an employees table. The
combo box on double click opens a form to enter an employee who is not yet in
the employee's table.

Of course when I return to the main form and try to select that newly
entered individual from the combo box it is not there. I have read back
through the groups and have tried the recommendations to no avail.

The latest I tried is in the combo box on click event is:

Private Sub cboEmployee_Click()

Me.cboEmployee.Requery

End Sub

The only way the newly entered employee will come up is if I close the form
and reopen it. I have also tried putting refresh into the forms got focus and
activate events also. Nothing.

Thank you in advance.
 
A requery should be all that's required. Are you sure that the Click event
is actually firing?
 
First thing to do is look at the property associated with the Click event in
the form designed. If it doesn't say [Event Procedure], you need to correct
that.

If that looks fine, put a message box inside the event (temporarily) to see
whether the event fires or not.

If there aren't too many records in the combo, you might consider using its
GotFocus event instead.
 
The event procedure is associated with the On Click event. This much I know
how to do. I do not know how to put a message box inside the event.

I did create a command button by wizard and i could have the user click this
(and then this works), but that is kind of poor to have the user do that. I
did copy the code from the command button into some of the events on the
combo box (focus, click, after update, etc.) to no avail.

I also tried to do this in the form's event without any luck either.


Douglas J Steele said:
First thing to do is look at the property associated with the Click event in
the form designed. If it doesn't say [Event Procedure], you need to correct
that.

If that looks fine, put a message box inside the event (temporarily) to see
whether the event fires or not.

If there aren't too many records in the combo, you might consider using its
GotFocus event instead.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


TinleyParkILGal said:
Thank you for your reply. I would not know how to identify if it is not
firing.
 
In the form where you input the Employee, you could check whether the other
form is open or not. If it is, issue the Requery when you're closing the
form.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


TinleyParkILGal said:
The event procedure is associated with the On Click event. This much I
know
how to do. I do not know how to put a message box inside the event.

I did create a command button by wizard and i could have the user click
this
(and then this works), but that is kind of poor to have the user do that.
I
did copy the code from the command button into some of the events on the
combo box (focus, click, after update, etc.) to no avail.

I also tried to do this in the form's event without any luck either.


Douglas J Steele said:
First thing to do is look at the property associated with the Click event
in
the form designed. If it doesn't say [Event Procedure], you need to
correct
that.

If that looks fine, put a message box inside the event (temporarily) to
see
whether the event fires or not.

If there aren't too many records in the combo, you might consider using
its
GotFocus event instead.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


TinleyParkILGal said:
Thank you for your reply. I would not know how to identify if it is not
firing.

:

A requery should be all that's required. Are you sure that the Click event
is actually firing?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


in
message Professionals:

I have a issue log form based on an issues table.

It contains a combo box for employee name based on an employees
table. The
combo box on double click opens a form to enter an employee who is
not yet
in
the employee's table.

Of course when I return to the main form and try to select that
newly
entered individual from the combo box it is not there. I have read back
through the groups and have tried the recommendations to no avail.

The latest I tried is in the combo box on click event is:

Private Sub cboEmployee_Click()

Me.cboEmployee.Requery

End Sub

The only way the newly entered employee will come up is if I close
the
form
and reopen it. I have also tried putting refresh into the forms got focus
and
activate events also. Nothing.

Thank you in advance.
 
Back
Top