Hi all,

How to create refresh Button in the form? I have combo box with the
data linked to Access database. I create another form for data input for
those that appear on the combo box. When I close the input form, I
realise that the data is not yet appear on the combo box. I have to
close the first form, then open again. Then the data had included on the
combo box. Instead of doing this thing, I believe refresh button will
help a lot.

Any help please.


The best way in getting the data loaded to your combo box is to write a function and then call it every time you need to re-load the data "refresh data".

You will use something like -

Private Function LoadMyData()

Set rsLoadMyData = New ADODB.Recordset

rsLoadMyData.Open "SELECT MyChosenFieldToLoad FROM MyDataTable", conn, ....


Do while rsLoadMyData.EOF = False
   combo1.AddItem rsLoadMyData!MyChosenFieldToLoad

End Sub

Under say a command button click event, you will have the following -

Call LoadMyData


Unload Me

I hope this is what you were looking for.

Hey friend,

Yes, this is what i was looking for. The function works better. Thank you so much for your kind help.


This question has already been answered. Start a new discussion instead.