View Full Version : requery command


kgcrowther
06-15-2001, 10:17 AM
This is the same question as ezpc's below. I have a combobox and from there you choose an instrument type from a combobox. There's a button, which opens a form to add the instrument to the list if needed.

When the instrument is added to the list I need to requery all the comboboxes in the form. (because many of them involve items from the list) Or someone requery or refresh the whole form.

What is the easiest way to set this up?

charityg
06-15-2001, 11:14 AM
dim ctl as control

for each ctl in me.controls
if ctl.controltype=accombobox then
ctl.requery
endif
next ctl

kgcrowther
06-15-2001, 11:42 AM
Hey thanks!

I put it in the On GotFocus event so that everytime the form gets the focus back it requeries everything.

It works great. I really appreciate your help!

Kenneth