User Defined Function in List Box

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
 
S

Steve Schapel

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.
 
O

Onno Willems

Didn't know I could call a VBA method in a query!

Thanks, got it working now ;-)
Onno
 

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