Refresh/Requery Form

M

Michael

Hi Folks - This seems like such an easy task .... However, I must be
braindead. I have a Main form. On the Main form, is a combo box that lists
doctor info. On the Main form, I have a button that opens a form that allows
for maintenance of a doctor info table. After they edit the doctor info, I
have to use RECORDS/REFRESH to 'update' the combo box info. My question ...
How can I programmatically refresh the form? Please be very specific about
the VBA code and location of the code that accomplishes the task. I have
tried numerous variations of .refresh and .requery. Thanks.

Michael
 
G

Guest

Michale:
I am sure there are many more qualified people to answer this question and
hopefully they will. Untill they do, what you could do is force the form to
recalculate and this would force your combo box to update. To accomplish
this all you need to to is add the line of code....."Me.Recalc" to the "On
Got Focus" event on the event tab for the combo box. It has worked in some
of my databases.

Hope it helps but as I said there are better qualified people out there and
hopefully the will give you a better answer.

FatMan
 
W

Wakajeje

Hi Mike,

This I believe should be a simple case of refreshing the control
itself, that is the combo box rather than the form. You do something
like the following for the "on activate" event for the form so that
when it regains focus the code runs >>

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

where MyComboControl is the name of your combo box control on the form.
This I believe should solve your problem. cheers.
 

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

Top