combo box not updated

F

Fred Loh

i have a combo box on my form. the combo box allow user to select a customer
from a list of customers. the data of the selected customer is then displayed
on the form by some code in the combo box's afterupdate() event. the combox
box's gotfocus() event set the combo box row source to "SELECT * FROM
[customer] WHERE [balance] > 0". so the combo box should display only
customer whose balance>0.

on the form there is a button. the button's onclick() event has code that
set the selected customer's balance = 0. so after the button is clicked, the
combo box should no longer show the customer in its list of customers. this,
however, is not happening. the customer whose balance has been set to 0 still
show in the combo box's customer list and will disappear only when the form
is closed and reopened.

how do i make sure the combo box always show the latest data only every time
the combo box is opened? i had a customercombo.requery line in both the combo
box's gotfocus() event and then again in the button's onclick() event but it
does not work either way.

thanks for your help.
 
N

NoodNutt

G'day Fred

In the OnClick() event put this in

Form.Refresh

It will update the form.

you don't need the GotFocus() unless it triggers something else when you set
the focus to the combo.

HTH
Mark.
 
F

Fred Loh

nope. didn't work. i put "form.refresh" both in the button's onclick"()
event and the combo box's onclick() event. the problem remains. the combo box
persistently shows the record whose balance have been set to 0.
 

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