how to update combo box Problem

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

MikeB

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

ghost

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

Adrian Brown

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
 
G

ghost

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
 

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

Similar Threads

Combo Box trouble 6
update combo box 6
Combo Box Update 22
Requery Combo box in subform. 0
Update combo box 2
Combo box question 7
combo box 1
parameter to populate 2nd combo 3

Top