User Defined Function in List Box

  • Thread starter Thread starter Onno Willems
  • Start date Start date
O

Onno Willems

Hi there,

I have a List Box on a form which I can basically fill the normal way (using
a query), except for one thing: i want 1 additional column which holds a
string that is constructed by a VBA function I wrote. I thought the way to
go was to set the RowSourceType Property to a User-Defined Function and to
fill the list from there. But I'm having a little trouble with this.

I think the problem is that that user defined function gets called at the
beginning of the calling order (before the form load?) and that there is no
current record at that moment yet. But I need a value from the current
record in my query! Am I right in assuming there is no current record yet?

Is there a way around this?

Thanks,
Onno Willems
The Netherlands
 
Onno,

I would suggest you make a query to use as the Row Source of your
listbox, with a column in this query using your UDF.
 
Didn't know I could call a VBA method in a query!

Thanks, got it working now ;-)
Onno
 
Back
Top