Refreshing a dropdown box

E

evilcowstare

Hi I have a form ( say FORM 1 )with a few drop down boxes on it.

The boxes get their field from a table via a query.

I have a button on the FORM 1 that will open up another form (say ADD FORM)
to be able to add new fields into the table. This is a form that opens up
after FORM 1 has loaded. The problem I have at the moment is that when I
close ADD FORM they new fields are not visible in the drop-down box until I
close it and re open it.

So is there anyway in which when I click the exit button it will refresh just
the drop-down box with the new fields or do I need to reload the whole form
again?

If you can give me simple instructions it would be appreciated, im a bit of a
novice.
Thank You
 
M

MikeJohnB

There are two commands in VBA that will do this for you.

DoCmd.Requery (Requeries the source)
Me.Refresh (Refreshes the data)

try in the on close event of the popup form

Private Sub Form_Close()
DoCmd.Requery
End Sub

I hope this helps?

ATB Mike B

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.
 
Top