How to update list box user defined callback function?

A

awu

Hi, All:
I have a single form with many records. I use following format to fill

in a list box with several columns using VBA:

Function functionname(fld As Control, id As Variant, row As Variant,
col As Variant, code As Variant) As Variant


The information in the list is from each record. When I select
different record, the list box should be updated.

I set RowSourceType property using function's name and leave "Row
Source" empty. Everything is working fine when the form is open first
time.

But when I choose different record by using arrow under the form, this
list box would not update. I would like to call the callback function
in Form_Current(). How do I decide callback function argument? I
don't know if this method is going to work or not?


Any solution for my question, or what is general way to update this
kind of list box? must need help


Thank you so much
awu
 
D

Dirk Goldgar

awu said:
Hi, All:
I have a single form with many records. I use following format to
fill

in a list box with several columns using VBA:

Function functionname(fld As Control, id As Variant, row As Variant,
col As Variant, code As Variant) As Variant


The information in the list is from each record. When I select
different record, the list box should be updated.

I set RowSourceType property using function's name and leave "Row
Source" empty. Everything is working fine when the form is open first
time.

But when I choose different record by using arrow under the form, this
list box would not update. I would like to call the callback function
in Form_Current(). How do I decide callback function argument? I
don't know if this method is going to work or not?


Any solution for my question, or what is general way to update this
kind of list box? must need help


Thank you so much
awu

Try requerying the list box in the Form_Current event procedure, using a
line of code like this:

Me!YourListboxName.Requery
 

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