how to update combo box Problem

  • Thread starter Thread starter ghost
  • Start date Start date
G

ghost

Greeting,

I have a form for adding new info. There is a combo box for initial of
employees. And there is a command button for open a form that allows to input
new initials. I put the following code in the main form with on current event
to update the combo box value

Private Sub Form_Current()
Me.CD_REP.Requery
End Sub

Where the "CD_Rep" is the combo box

The code is working fine and I could add data but when I close the form of
Initials and reopen it and add more initial, the new initials do not appear
unless closing the form and reopen it.

Can any body help me please?
 
Greeting,

I have a form for adding new info. There is a combo box for initial of
employees. And there is a command button for open a form that allows to input
new initials. I put the following code in the main form with on current event
to update the combo box value

Private Sub Form_Current()
Me.CD_REP.Requery
End Sub

Where the "CD_Rep" is the combo box

The code is working fine and I could add data but when I close the form of
Initials and reopen it and add more initial, the new initials do not appear
unless closing the form and reopen it.

Can any body help me please?

There is a "requery" action that you can do. I cannot remember exactly
how/where, but a search on that might yield some fruit.
 
Hi Mike
I tried but there is no fruit


MikeB said:
There is a "requery" action that you can do. I cannot remember exactly
how/where, but a search on that might yield some fruit.
 
How are you filling the combo box? If you are using a macro to open the
form on the command button then add the requery after the form open part of
the macro and see if that has the desired effect.

Adrian
 
Thank you Adrian, it Works

Adrian Brown said:
How are you filling the combo box? If you are using a macro to open the
form on the command button then add the requery after the form open part of
the macro and see if that has the desired effect.

Adrian
 
Back
Top